Results 1 to 2 of 2

Thread: Vba code to just find red font color text in powerpoint
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Nov 2018
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Vba code to just find red font color text in powerpoint

    Dear Team,

    I am using the mentioned vba code to find text in font color red in powerpoint . The below mentioned code i was using to find red color font text in ms word.

    Code:
    Sub newred()
        Selection.Find.ClearFormatting
        Selection.Find.Font.Color = wdColorRed
        With Selection.Find
            .Text = ""
            .Replacement.Text = ""
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
        Selection.Find.Execute
    End Sub
    Further, I need to find the red color font text in each slide of my presentation.

    I could not get the subroutine to successful run in the powerpoint.

    Please help me with that.

    Regards
    Last edited by shoun2502; Sep 17th, 2019 at 05:54 AM. Reason: forgot tagging

  2. #2
    New Member
    Join Date
    Nov 2018
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Vba code to just find red font color text in powerpoint

    I have written a subroutine as mentioned below but could not get the desired result

    Code:
    Sub findred()
        Dim aslide As Slide
        Dim ashape As Shape
        For Each aslide In ActivePresentation.Slides
            For Each ashape In aslide.Shapes
                If ashape.Type = msoTextBox Then
                    If ashape.TextFrame2.HasText Then
                        If ashape.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(255, 0, 0) Then
                        End If
                         End If
                          End If
                                  Next ashape
        Next aslide
    End Sub

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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