I'm trying to change the font size of the text within shapes in Visio from data exported from an Excel document using Visual Basic. I need there to be different font sizes for different shapes. Is there a Shape.FontSize = X method or something similar in VBA? I'm new to Visual Basic so apologies if this is a rookie question. Thank you for your help!
Asked
Active
Viewed 3,022 times
2 Answers
2
In MS Visio you can change properties in ShapeSheetâ„¢ environment for change font parameters
Dim shp As Shape
Set shp = ActivePage.Shapes.ItemFromID(4)
shp.Cells("Char.Size").FormulaU = "12 pt"

Surrogate
- 1,466
- 2
- 11
- 13
-
Brilliant, thank you! Do you know if there's a similar way to add bold or italics to the font? – PythonParka Jul 25 '17 at 09:47
0
I find another way change font size
Dim shp As Shape
Set shp = ActivePage.Shapes.ItemFromID(1)
With shp.Characters
' set font size - 6 pt
.CharProps(visCharacterSize) = 6
' set font bold, italic and underline
.CharProps(visCharacterStyle) = visBold + visItalic + visUnderLine
End With

Surrogate
- 1,466
- 2
- 11
- 13