Link to home
Start Free TrialLog in
Avatar of Bryce Bassett
Bryce BassettFlag for United States of America

asked on

How do I set a SHADE of a theme color in Office 2010 using VBA

In PowerPoint 2010, I know how to set the color of an object to a theme color using VBA, for example:
myshape.Line.ForeColor.ObjectThemeColor = 4

Open in new window

But what is the correct way to set it to one of the shades of the theme color as illustrated in the palette below the theme colors themselves, for example the 4th color, 3rd shade down as circled in red?
User generated imageAre these shades directly addressable?  If so, how?

Or do you have to use TintAndShade method?  I tried that, but it doesn't seem to work for me.

Thanks.
shadeoftheme.JPG
Avatar of Rgonzo1971
Rgonzo1971

Hi,
You should use .Brightness

to replicate the choice in the ribbon

use one of these
myshape.Line.ForeColor.ObjectThemeColor = 4
'myshape.Line.ForeColor.Brightness = 0
'myshape.Line.ForeColor.Brightness = 0.8
'myshape.Line.ForeColor.Brightness = 0.6
myshape.Line.ForeColor.Brightness = 0.4 ' In your case
'myshape.Line.ForeColor.Brightness = -0.25
'myshape.Line.ForeColor.Brightness = -0.5

Open in new window

Regards
That's a good find. The help for brightness is appalling and for tintandshade worse!

I would have thought it would be  TintAndShade with those exact values but in PowerPoint it doesn't work! (It does in Word)
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bryce Bassett

ASKER

Brightness.  Who knew?

Thanks.  Just what I needed.