Real text wrapping; no bloody carriage.
Visio 2010. SysML Stencil (source unknown) The "Activity" form in the "Activity Diagram" shape collection.
- If you donβt see the Developer tab on the ribbon:
- File> Options> Customize Ribbon> [Select "Developer" in the "Main Tabs" list]
- Right-click the form you are interested in and select "Show Form"
- Find the width property of interest
- Change the formula in the TxtWidth property cell
- from (something like) '= MAX (Char.Size, TEXTWIDTH (TheText))'
- to '= MIN (Width-0.08, MAX (Char.Size, TEXTWIDTH (TheText)))
Enjoy it.
The magic here is decrement -0.08. Without this, I could not have made the figure smaller, because the formula would not allow the width of the text to be less than the width of the form, and the width of the form would automatically limit the width of the text to at least the width. Fun. You may find that you need a larger decrement or you can leave with a thinner one.
Save the form in which you made this change to the stencil, if you can.
Here is the quick / dirty VBA that I used to apply the formula to all the "Action" blocks:
Public Sub ApplyWrapTextPropertyToAllActionBlocks() Const STR_ACTION_BLOCK_NAME As String = "Action with Wrap Text." Const STR_DECREMENTER As String = "-0.08" Dim objShape As Shape Dim objActionBlock As Shape For Each objShape In ActivePage.Shapes If InStr(1, objShape.Name, STR_ACTION_BLOCK_NAME, vbBinaryCompare) <> 0 Then Debug.Print "Found one: " & objShape.Name Set objActionBlock = objShape objActionBlock.CellsU("TxtWidth").Formula = "=MIN(Width" & STR_DECREMENTER & ",MAX(Char.Size,TEXTWIDTH(TheText)))" End If Next objShape
End Sub
Tom
source share