|
-
Oct 30th, 2005, 07:13 PM
#1
Thread Starter
New Member
Selecting All Objects By Text Color [Powerpoint]
Hey, I'm trying to select all text boxes in a powerpoint file by the color of the text. Once selected, I would like to change the color of the text. Is it possible to enumerate all the text boxes in the file and then go through one by one? If so, what methods would I need to use? Thanks.
-
Nov 1st, 2005, 05:46 AM
#2
Re: Selecting All Objects By Text Color [Powerpoint]
This code enumerate all objects on all slides in the first presentation.
It checks for text boxes with forn color 0 (black) and replaces the color with 255 (red). Just remember that a text box can have multiple text formats (colors, fonts, sizes etc), and this code will only check the first font format and if the color matches it will replace the font color of the entire text box.
VB Code:
Dim app As Application
Dim sl As Slide
Dim shp As Shape
Set app = Application
For Each sl In app.Presentations(1).Slides
For Each shp In sl.Shapes
If shp.Type = msoTextBox Then
If shp.TextFrame.TextRange.Font.Color.RGB = 0 Then
shp.TextFrame.TextRange.Font.Color.RGB = 255
End If
End If
Next shp
Next sl
Set shp = Nothing
Set sl = Nothing
set app=nothing
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|