Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / June 2009

Tip: Looking for answers? Try searching our database.

VBA- how to retrieve a color in a colortheme

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Edward - 30 Jun 2009 17:31 GMT
Hi everybody,
I have several customized colortheme in PP2007 , I need to retrieve Accent1
color and apply to the backcolor of a lable in a user form.
lblMyLable.BackColor=…  
I can't find a way of doing this ...
for a shape in a slide it's easy for example for a cell in a table I use the
following code

.Cell(1, 1).Shape.Fill.ForeColor.ObjectThemeColor=msoThemeColorAccent1

but I don't know how to apply accent1 or retrieve it's color and apply to a
lable in a userform
Any suggestion greatly appreciated
Signature

Best regards,
Edward

Steve Rindsberg - 30 Jun 2009 20:01 GMT
> Hi everybody,
> I have several customized colortheme in PP2007 , I need to retrieve Accent1
[quoted text clipped - 5 lines]
>
> ..Cell(1, 1).Shape.Fill.ForeColor.ObjectThemeColor=msoThemeColorAccent1

oSh.Fill.ForeColor.ObjectThemeColor = 7

or

oSh.Fill.ForeColor.ObjectThemeColor = msoThemeColorAccent3

==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/
Edward - 30 Jun 2009 21:00 GMT
Thanks Steve,
This method is only working for shapes on a slide .
What I'm trying to do is to write some code to change the backcolor of a
lable in a userform-Initialize() event.
I used

Private Sub UserForm_Initialize()
Dim shp
set shp=Me.lbl1Header
shp.Fill.ForeColor.ObjectThemeColor=msoThemeColorAccent1
and it generates an error
End Sub

Any suggestions
Signature

Best regards,
Edward

> > Hi everybody,
> > I have several customized colortheme in PP2007 , I need to retrieve Accent1
[quoted text clipped - 18 lines]
> PPTools add-ins for PowerPoint
> http://www.pptools.com/
Steve Rindsberg - 30 Jun 2009 21:37 GMT
> Thanks Steve,
> This method is only working for shapes on a slide .
[quoted text clipped - 7 lines]
> shp.Fill.ForeColor.ObjectThemeColor=msoThemeColorAccent1
> and it generates an error

It's always a good idea to mention that you're working with controls rather
than shapes.  Saves time, saves wrong answers. <g>  They're TOTALLY
different animals.

You can't use theme or scheme colors with controls, you need to specify RGB
colors.

To get a given them color's RGB (this should be all in one line):

Debug.Print ActivePresentation.Slides(1).ThemeColorScheme.Colors
(msoThemeAccent2).RGB

==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.