Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-10-2017, 12:46 AM
JohnWilson JohnWilson is offline "If it's a red bolded space, highlight it" macro? Windows 7 64bit "If it's a red bolded space, highlight it" macro? Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,914
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
"If it's a red bolded space, highlight it" macro? how to highlight all "indexed" sentences using find and replace? smallxyz Word 2 02-06-2016 02:54 AM
"If it's a red bolded space, highlight it" macro? space bar "deletes" as it "spaces" S.R.C. Word 2 04-19-2015 05:56 AM
remove repeated words with " macro " or " wild cards " in texts with parentheses and commas jocke321 Word VBA 2 12-10-2014 11:27 AM
Wierd symbols inplace of "space", "indentation" etc aka.bhagvanji Word 5 02-16-2012 11:50 AM
"If it's a red bolded space, highlight it" macro? The heading doesn't "obey" the "before" space! why? Jamal NUMAN Word 1 07-06-2011 04:25 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft