Vba code to just find red font color text in powerpoint

shoun2502

New Member
Joined
Nov 14, 2018
Messages
29
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:

shoun2502

New Member
Joined
Nov 14, 2018
Messages
29
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
 

Forum statistics

Threads
1,085,466
Messages
5,383,862
Members
401,859
Latest member
tomahawk61

Some videos you may like

This Week's Hot Topics

Top