Search+Replace with Formats

  • Thread starter Thread starter thinkstorm
  • Start date Start date
T

thinkstorm

Hi all,
I need to replace a recurring phrase in my PowerPoint 2003 with a
certain format - namely a different font (no different font-size,
though).

Is there an add-in available, or do I have to adapt various scripts
flying around, such as http://skp.mvps.org/ppt00025.htm#2?

Cheers,
Thorsten
 
Thinkstorm said:
Hi all,
I need to replace a recurring phrase in my PowerPoint 2003 with a
certain format - namely a different font (no different font-size,
though).

Is there an add-in available, or do I have to adapt various scripts
flying around, such as http://skp.mvps.org/ppt00025.htm#2?

I don't know of any add-in but this should do it for you:

Sub FormatThePhrase()

Dim oSl As Slide
Dim oSh As Shape
Dim lStartPos As Long
Dim sSearchPhrase As String

' EDIT THIS TO REFLECT THE PHRASE YOU'RE LOOKING FOR
sSearchPhrase = "my phrase"

For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
If oSh.HasTextFrame Then
If oSh.TextFrame.HasText Then
lStartPos = InStr(UCase(oSh.TextFrame.TextRange.Text), _
UCase(sSearchPhrase))
If lStartPos > 0 Then
' make it bold, for example:
oSh.TextFrame.TextRange.Characters(lStartPos, _
Len(sSearchPhrase)).Font.Bold = True
End If
End If
End If
Next
Next

End Sub
 
Back
Top