Consulting

Results 1 to 2 of 2

Thread: Powerpoint - find and replace tabs in a string

  1. #1
    VBAX Newbie
    Joined
    Feb 2013
    Posts
    1
    Location

    Powerpoint - find and replace tabs in a string

    Hi,

    I don't usually use PowerPoint so am used to Word's record macro function, could really use some help! Someone has given me over 500 slides where all the bullet points which go onto two lines have been made by hitting enter rather than just typing onto the next line... no idea why. The author then aligned the left edge of the text by hitting tab on the second/third lines of the bullets.

    I figured the easiest way to fix this would be a search and replace of "(text)paragraph mark,tab character(text)" but haven't really got a clue how to go about doing this in VBA. I've tried looking around on google for some answers but didn't really get anywhere.

    Can anyone help?

    Thanks!

    Bill

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,096
    Location
    Whether you can do this will depend on EXACTLY what they did!

    (Foolproof?? Never underestimate the ingenuity of fools)

    This might work but test on a copy!

    Sub replaceMe()
    Dim osld As Slide
    Dim oshp As Shape
    For Each osld In ActivePresentation.Slides
    For Each oshp In osld.Shapes
    If oshp.HasTextFrame Then
    'look for newline followed by Tab and switch to SPACE
    With oshp.TextFrame.TextRange
    .Text = Replace(.Text, vbCr & vbTab, " ")
    End With
    End If
    Next oshp
    Next osld
    End Sub
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

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