Real text wrap; no bloody carriage returns.
Visio 2010.
SysML Stencil (source unknown) 'Activity' shape in 'Activity Diagram' shapes collection.
- If you cannot see the 'Developer' tab on the ribbon:
File > Options > Customize Ribbon > [Select 'Developer' in 'Main Tabs' list]
- Right-click shape of interest and select 'Show Shapesheet'
- Find the width property of interest
Text Transform > TxtWidth
- 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.
The magic here is the decrementer -0.08. Without it, I couldn't make the shape any smaller because the formula would not allow the text width to be smaller than the shape width, and the shape width appeared to automatically limit itself to, at minimum, the text width. Fun. You may find you need a larger decrementer or that you can get away with a finer one.
Save the shape to which you've made this change into the stencil if you can.
Here is the quick/dirty VBA I used to apply the formula change across 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