Solved

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

Posted on 2014-02-18
4
708 Views
Last Modified: 2014-02-19
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?
shadeAre 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
0
Comment
Question by:versatilebb
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 39869908
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
0
 
LVL 23

Expert Comment

by:JSRWilson
ID: 39870183
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)
0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 300 total points
ID: 39870225
Correction of my Post

You have to adapt the percentage according to your palette

wait for the tool tip appearing at your colour  and then adjust the Brightness accordingly

Darker 25% : means .Brightness = -0.25
Lighter 40% : means .Brightness = 0.4

Regards
0
 

Author Closing Comment

by:versatilebb
ID: 39871248
Brightness.  Who knew?

Thanks.  Just what I needed.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question