Global search and replace for colors

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way, with an add-in, the script editor, or any other method to
globally replace one color with another?

I'm working on several 100+ slide presentations, with complex diagrams,
shapes, etc (so it's not just a matter of reapplying a layout to change text
color). There is a corporate style guide, and it includes things as to which
shades of which colors you can use. This has not always been followed, so I
need to replace the "green" with a specific RGB value.

It looked like I might be able to do some of this in script editor, but I
would need to open each of the 100+ slides, and it didn't look like it would
save me much time.

Anyone have any times for globally searching things other than text in
powerpoint? I'm also going to need to be picky on fonts, font sizes, etc.

Thanks!
 
Hi,
I would assume that the color in question is not a scheme color but a custom
color. I haven't completed an add-in to support such operations however the
code to it is already provided here:
Find and replace one color with another on fills, text and borders

http://skp.mvps.org/pptxp006.htm
 
I saw that, fiddled a little bit, and couldn't understand it enough to make
it work. Would you mind helping explain it to me? I'm assuming this bit here
is where I put in my desired old and new RGB colors, and I can tell the text,
fill, and border apart.

What I don't understand is the two RGB listings in each group, I see four
RGB entries total for each text, fill, and border. I'm not sure where to put
the old and the new, do I need to put each twice, etc.

Thank you

Call FindAndReColourText(oShp.GroupItems(I), _
RGB(100, 100, 100), RGB(255, 0, 255))
Call FindAndReColourFill(oShp.GroupItems(I), _
RGB(255, 255, 255), RGB(255, 0, 255))
Call FindAndReColourBorder(oShp.GroupItems(I), _
RGB(100, 100, 100), RGB(255, 0,
255))
Next I
Else
Call FindAndReColourText(oShp, _
RGB(100, 100, 100), RGB(255, 0, 255))
Call FindAndReColourFill(oShp, _
RGB(255, 255, 255), RGB(255, 0, 255))
Call FindAndReColourBorder(oShp, _
RGB(100, 100, 100), RGB(255, 0, 255))
 
PowerPoint shapes are of different kinds. There are group shapes while
require slightly different processing from normal shapes since they are
groups of normal shapes hence there is a specific branch to handle group
shapes while all the shapes are enumerated on the slide.

What you need to do is to change the arguments for old/new color to your
specific values where ever they occur. If you only want to search for shape
fills then you can comment out the other two calls which handle line and
text color.

RGB(100, 100, 100) - Change all occurances to the color to look for
RGB(255, 0, 255)) - Change all occurances to the color to change to
 
I think I understand everything now. The thing confusing me was the else -
does this let me do two old and two new at a time?

This will help me greatly, thank you so much for writing this, and for
helping to explain.
 
Nevermind, the coffee kicked in and I see what you mean now, the two sets are
for groups and non-groups.
 
Back
Top