Background Color PowerPoint

A

Aurora I

Hi,
If the user wants to pick up a new color for background and selects a color
scheme and selects one of 8 colors in the second row, below "Automatic", how
do I get programacticly that information about that color?

Aurora I.
www.smarttech.com
 
S

Steve Rindsberg

Hi,
If the user wants to pick up a new color for background and selects a color
scheme and selects one of 8 colors in the second row, below "Automatic", how
do I get programacticly that information about that color?

Have you tried recording a macro in PPT while you do that yourself?
It should tell you what you need to know.
 
A

Aurora I

Steve Rindsberg said:
Have you tried recording a macro in PPT while you do that yourself?
It should tell you what you need to know.

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================

Recording a macro I get as following:

With ActiveWindow.Selection.SlideRange
.FollowMasterBackground = msoFalse
.DisplayMasterShapes = msoTrue
With .Background
.Fill.Visible = msoTrue
.Fill.ForeColor.SchemeColor = ppForeground
.Fill.Transparency = 0#
.Fill.Solid
End With
End With

where Fill.ForeColor.SchemeColor can take one of the value in
enum PpColorSchemeIndex { ppSchemeColorMixed = -2, ppNotSchemeColor = 0,
ppBackground = 1, ppForeground = 2, ppShadow = 3, ppTitle = 4, ppFill = 5
ppAccent1 = 6, ppAccent2 = 7, ppAccent3 = 8 };

The problem is how do I know which value gets assigned i.e which color from
color scheme has been selected, since user may assign to the background any
color in color scheme, that being the case I am interested in.

Thank you very much, waiting for reply
Aurora
www.smarttech.com
 
S

Steve Rindsberg

Recording a macro I get as following:

With ActiveWindow.Selection.SlideRange
.FollowMasterBackground = msoFalse
.DisplayMasterShapes = msoTrue
With .Background
.Fill.Visible = msoTrue
.Fill.ForeColor.SchemeColor = ppForeground
.Fill.Transparency = 0#
.Fill.Solid
End With
End With

where Fill.ForeColor.SchemeColor can take one of the value in
enum PpColorSchemeIndex { ppSchemeColorMixed = -2, ppNotSchemeColor = 0,
ppBackground = 1, ppForeground = 2, ppShadow = 3, ppTitle = 4, ppFill = 5
ppAccent1 = 6, ppAccent2 = 7, ppAccent3 = 8 };

The problem is how do I know which value gets assigned i.e which color from
color scheme has been selected, since user may assign to the background any
color in color scheme, that being the case I am interested in.

Without knowing exactly what you need, it seems that

oSld.Background.Fill.ForeColor.SchemeColor

will give you the scheme color the user selected.

oSld.Background.Fill.ForeColor.RGB

should give you the rgb value of the color
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top