Consulting

Results 1 to 6 of 6

Thread: Find and Replace Text Color

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Oct 2015
    Posts
    21
    Location

    Find and Replace Text Color

    Hello,

    Ihave the following code that will change some text color from blue to black.However, it is missing the blue text from tables, charts, etc. How can Ienhance the code below to include tables, charts, etc? Also, how can I enhancethe table to also include finding and replacing red text to black text?

    Sub BlackDeletei()
    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.Color.RGB = RGB(0, 0, 255) Then
                                .Runs(x).Font.Color.RGB = RGB(0, 0, 0)
                            End If
                        Next x
                    End With
                End If
            End If
        Next oShp
    Next oSld
    
    End Sub
    Thank you
    Last edited by Aussiebear; 04-24-2023 at 05:05 AM. Reason: Edited the font size

Posting Permissions

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