View Single Post
 
Old 07-10-2017, 12:46 AM
JohnWilson JohnWilson is offline Windows 7 64bit Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Your code depends on all the text being red and bold which may not be true but also Replace > Whole words setting will cause problems because of the way spaces are treated (not as words)

This code does not use replace and should unbold spaces and set to black (you can easily change the black to whatever) It may take a little while but a lot faster than manually!! Make sure you test on a copy

Code:
Sub killRed()
   Dim otr As TextRange
   Dim oshp As Shape
   Dim L As Long
   Dim C As Long
   Dim osld As Slide
   For Each osld In ActivePresentation.Slides
      For Each oshp In osld.Shapes
         If oshp.HasTextFrame Then
            If oshp.TextFrame.HasText Then
               For L = oshp.TextFrame.TextRange.Paragraphs.Count To 1 Step -1
                  Set otr = oshp.TextFrame.TextRange.Paragraphs(L)
                  For C = otr.Characters.Count To 1 Step -1
                     If Asc(otr.Characters(C)) = 32 Or Asc(otr.Characters(C)) = 13 Then
                        If otr.Characters(C).Font.Color = vbRed And otr.Characters(C).Font.Bold = True Then
                           'otr.Characters(C) = "@" optional
                           'delete this to change to @
                           '''''''''''''''''''
                           otr.Characters(C).Font.Bold = False
                           otr.Characters(C).Font.Color = vbBlack
                           ''''''''''''''''''''
                        End If
                     End If
                  Next C
               Next L
            End If
            End If
         Next oshp
      Next osld
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote