PDA

View Full Version : [SOLVED:] Toggle Word Wrap in selected shape or shapes



RayKay
10-21-2019, 07:18 AM
Hi John

I need to make a button that toggles word wrap in a shape, or selected shapes.
When the button is pressed, it either wraps or unwraps text (toggles between them)



.WordWrap = False


This is all I have, and have tried many variants, but sadly failed.

I know how to make the button, it's just the VBA / Macro behind it I'm stuck on.

Thank you.

John Wilson
10-21-2019, 12:27 PM
Maybe


Sub toggWW()
Dim oshp As Shape
For Each oshp In ActiveWindow.Selection.ShapeRange
If oshp.HasTextFrame Then
oshp.TextFrame.WordWrap = Not oshp.TextFrame.WordWrap
DoEvents
End If
Next
End Sub

RayKay
10-22-2019, 02:03 AM
Works perfect. Thanks John :) yet again you're a star!
:yes