In Visio, I am trying to set a tab stop in a text box that doesn't have any 
tabs.
I'm running Window 7, Viso 2013, and Python 2.7.10.

-----------------
import win32com.client
from win32com.client import constants

win32com.client.gencache.EnsureDispatch("Visio.Application")
visapp = win32com.client.Dispatch("Visio.Application")
doc = visapp.Documents.Add("")
page = visapp.ActivePage

s1 = page.DrawRectangle(1.0, 8.5, 3.75, 9.75) s1.Text = "this\tis\ta\ttest"
s1.CellsSRC(constants.visSectionTab, 0, constants.visTabStopCount).FormulaU = 
"1"
s1.CellsSRC(constants.visSectionTab, 0, constants.visTabPos).FormulaU = "0.7 in"
s1.CellsSRC(constants.visSectionTab, 0, constants.visTabAlign).FormulaU = "0"
s1.CellsSRC(constants.visSectionTab, 0, 3).FormulaU = "0"
-----------------

But the tab shows up as UNKNOWN_TOKEN_0
Some posts say that I need to set the RowType first.
s1.RowType(constants.visSectionTab, constants.visRowTab) = 151
where 151 is visTagTab10, but this gets an error: SyntaxError: can't assign to 
function call

I hope you can help.

____________________________________________
Kevin Miller
(949) 705-2926  /  x52926

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to