Solved

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

Posted on 2014-02-18
4
685 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 48

Expert Comment

by:Rgonzo1971
Comment Utility
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
Comment Utility
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 48

Accepted Solution

by:
Rgonzo1971 earned 300 total points
Comment Utility
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
Comment Utility
Brightness.  Who knew?

Thanks.  Just what I needed.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now