Change all text that has a specific font
I have some documents which have rubrics in a special font. In WordPerfect I have a macro which searches for that font and changes it to red text. I would like to do the same thing in PowerPoint. I have done quite a lot of scripting but am new to VBA. So far, I have only written one VBA macro. I goes through a PowerPoint slide show and changes all the titles to the same font face, size, and color. Mostly it was cut and pasted from material I found online but I think I understand the workflow. I do not know how to parse the text within a TextFrame or determine the font at the cursor.
[SOLVED] Change all text that has a specific font
Thanks I figured it out after looking at this post by MHamid:
{Sorry I can't seem to post the link}
Code:
Sub Color_Rubrics()
Dim oSld As Slide
Dim oShp As Shape
Dim x As Long
For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.HasTextFrame Then
If oShp.TextFrame.HasText Then
With oShp.TextFrame.TextRange
For x = .Runs.Count To 1 Step -1
If .Runs(x).Font.Name = "LSBSymbol" Then
.Runs(x).Font.Color.RGB = RGB(255, 0, 0)
End If
Next x
End With
End If
End If
Next oShp
Next oSld
End Sub