ApplicationSettings.StencilCharactersPerLine Property (Visio)
Published: July 16, 2012
For shapes on stencils, determines approximately how many characters of each shape's name appear on each line before the text wraps to the next line. Read/write.
Setting the StencilCharactersPerLine property is equivalent to setting the Characters per line option under Stencil spacing on the Advanced tab in the Visio Options dialog box (click the File tab, and then click Options).
The minimum value for StencilCharactersPerLine is 5 characters per line and the maximum is 20. By default, Visio displays 12 characters per line.
This property affects the overall spacing of shapes on a stencil, which affects how many shapes the user can see without scrolling.
This Microsoft Visual Basic for Applications (VBA) macro shows how to use the StencilCharactersPerLine property to print the current number of stencil characters per line in the Immediate window. It also shows how to get an ApplicationSettings object from the Visio Application object.
Public Sub StencilCharactersPerLine_Example()
Dim vsoApplicationSettings As Visio.ApplicationSettings
Dim lngCharsPerLine As Long
Set vsoApplicationSettings = Visio.Application.Settings
lngCharsPerLine = vsoApplicationSettings.StencilCharactersPerLine
Debug.Print lngCharsPerLine
End Sub