nsalyani
06-02-2011, 11:14 AM
Hi there,
I basically have 2 slides on my powerpoint show. Each slide has four shapes with different text in it (A B C D E F G H). I want to search for the letter B on the first (ACTIVE) Slide and change it's shape color to ORANGE. Then move onto the same slide (NEW ACTIVE SLIDE), run the same code and search letter G on the Slide and do the same thing.
I have the following code working. However, this code searches the entire presentation for B or G and colors both the shapes to orange. I tried using WIth Statements in order to search an ACTIVE SLIDE but it din't work for some reason. COuld someone help out please!
For Each ss In ActivePresentation.Slides
For Each shp2 In ss.Shapes
If shp2.HasTextFrame Then
If StrComp(shp2.TextFrame.TextRange, "B" Or "G", vbTextCompare) = 0 Then
shp2.Fill.ForeColor.RGB = RGB(255, 165, 0)
End If
End If
Next shp2
Next ss
I basically have 2 slides on my powerpoint show. Each slide has four shapes with different text in it (A B C D E F G H). I want to search for the letter B on the first (ACTIVE) Slide and change it's shape color to ORANGE. Then move onto the same slide (NEW ACTIVE SLIDE), run the same code and search letter G on the Slide and do the same thing.
I have the following code working. However, this code searches the entire presentation for B or G and colors both the shapes to orange. I tried using WIth Statements in order to search an ACTIVE SLIDE but it din't work for some reason. COuld someone help out please!
For Each ss In ActivePresentation.Slides
For Each shp2 In ss.Shapes
If shp2.HasTextFrame Then
If StrComp(shp2.TextFrame.TextRange, "B" Or "G", vbTextCompare) = 0 Then
shp2.Fill.ForeColor.RGB = RGB(255, 165, 0)
End If
End If
Next shp2
Next ss