0
votes

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!

2

2 Answers

2
votes

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" 
0
votes

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