Consulting

Results 1 to 3 of 3

Thread: Toggle Word Wrap in selected shape or shapes

  1. #1
    VBAX Regular
    Joined
    Dec 2018
    Posts
    95
    Location

    Toggle Word Wrap in selected shape or shapes

    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)

    HTML Code:
    .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.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    1,879
    Location
    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
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Dec 2018
    Posts
    95
    Location
    Works perfect. Thanks John yet again you're a star!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •