Hi, you can change font size with code
shpObj1.Cells("Char.size").FormulaU = "7.40 pt"
What you mean as style ?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In the below sample program, I want to change font size and style when I drop text.
I tried few thing but not able to do that.
Can anyone please guide me.
Thank you
---- Sample program ----
from win32com.client import constants
appVisio = win32com.client.Dispatch("Visio.Application")
appVisio.Visible =1
doc = appVisio.Documents.Add("Basic Diagram.vst")
pagObj = doc.Pages.Item(1)
stnObj = appVisio.Documents("Basic Shapes.vss")
mastObj = stnObj.Masters("Rectangle")
shpObj1 = pagObj.Drop(mastObj, 4.25, 5.5)
shpObj1.Text = "This is some text."
shpObj2 = pagObj.Drop(mastObj, 2, 2)
shpObj2.Text = "This is some more text."
connectorMaster = appVisio.Application.ConnectorToolDataObject
connector = pagObj.Drop(connectorMaster, 0, 0)
connector.Cells("BeginX").GlueTo(shpObj1.Cells("PinX"))
connector.Cells("EndX").GlueTo(shpObj2.Cells("PinX"))
doc.SaveAs(r'e:\temp\MyDrawing.vsd')
doc.Close()
appVisio.Visible =0
Hi, you can change font size with code
shpObj1.Cells("Char.size").FormulaU = "7.40 pt"
What you mean as style ?
Text Style in Visio is a set of settings of text such as font type, font size, font color, line spacing and so on. If you apply text style to shape, this make shape parameters according style settings. But since version 2007 in Visio was added Themes, the Styles have become obsolete, but they still exist, but you have to try very hard to find them in the user interface! May be you mean font type ? ![165027-font-type.png][1] [1]: /api/attachments/165027-font-type.png?platform=QnA
Hi Bhushna ,
can you please assit me on visio automation using xl contain to past on visio files