PDA

View Full Version : [SOLVED:] Changing the color of text and shapes in all the presentation



Clev47
01-17-2023, 06:40 AM
Hello,

I print a lot of presentations, and in order to save ink I need to change the text color from whatever to black, and the shapes (that contain text) fill color from whatever to white.
I keep the shapes that doesn't contain text with there original color.
Sometimes I can do this by changing the color scheme or on the Slide Master, but in a lot of presentations the colors has been modified manuely, so I need to go through all the slides one by one and it takes a lot of time, especially when the presentation has 100+ slides.

I need a VBA code that can automate this task for me.

Thank you in advance.

John Wilson
01-17-2023, 09:16 AM
This should be close but test on a COPY of the presentation first!


Sub To_black()
Dim osld As Slide
Dim oshp As Shape
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.HasTextFrame Then
If oshp.TextFrame.HasText Then
oshp.Fill.ForeColor.RGB = vbWhite
oshp.TextFrame.TextRange.Font.Color.RGB = vbBlack
End If
End If
Next oshp
Next osld
End Sub

Clev47
01-18-2023, 01:20 AM
OMG it works perfectly, you can not imagine how much you helped me, thank you so much.

John Wilson
01-18-2023, 06:14 AM
Glad it helped!