Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
developer
active.documents
automation
binary.file_format
clipboard.dde
com.add_ins
hosting.controls
internet_other
office.sdks
officedev
officedev.other
outlook.forms
outlook.vba
smarttags
vba
web.components
  
 
date: Mon, 04 Aug 2008 18:50:35 +0200,    group: microsoft.public.office.developer.automation        back       


[Powerpoint] How to get a shape's background color?   
I want to get the background color of a shape from a powerpoint slide. 
I've found two shape properties: "forecolor" and "backcolor".

For most transparent textboxes in  my ppt file "backcolor" always 
returns the color value for "white" (#ffffff) and "forecolor" returns 
"#00cc99". However the textbox actually doesn't have any background 
color set - it is transparent.

What am I doing wrong? How do I get correct color or find out, if the 
background is transparent?

Thanks
Daniel
date: Mon, 04 Aug 2008 18:50:35 +0200   author:   Daniel Kirsch

Re: [Powerpoint] How to get a shape's background color?   
In article <g77b25$1u0$02$1@news.t-online.com>, Daniel Kirsch wrote:
> I want to get the background color of a shape from a powerpoint slide. 
> I've found two shape properties: "forecolor" and "backcolor".
> 
> For most transparent textboxes in  my ppt file "backcolor" always 
> returns the color value for "white" (#ffffff) and "forecolor" returns 
> "#00cc99". However the textbox actually doesn't have any background 
> color set - it is transparent.
> 
> What am I doing wrong? How do I get correct color or find out, if the 
> background is transparent?

In this case, background doesn't mean background.  

Backcolor is only used when you apply a patterned fill to the shape.  The 
pattern is in ForeColor, the rest is in backcolor.

Otherwise the shape color is Forecolor; transparency is a separate property 
that doesn't affect fill color:

    With ActiveWindow.Selection.ShapeRange(1)
        Debug.Print .Fill.ForeColor
        Debug.Print .Fill.Transparency
    End With


--
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
date: Mon, 04 Aug 2008 15:04:46 EDT   author:   Steve Rindsberg

Re: [Powerpoint] How to get a shape's background color?   
Steve Rindsberg wrote:
> Backcolor is only used when you apply a patterned fill to the shape.  The 
> pattern is in ForeColor, the rest is in backcolor.
> 
> Otherwise the shape color is Forecolor; transparency is a separate property 
> that doesn't affect fill color:
> 
>     With ActiveWindow.Selection.ShapeRange(1)
>         Debug.Print .Fill.ForeColor
>         Debug.Print .Fill.Transparency
>     End With

Steve, thanks for that info. (I was on vacation so my answer is a bit 
delayed :-)

I get the following values:
Transparency : 0.0
ForeColor : #00cc99
BackColor : #ffffff
TextureType : -2
Pattern : -2

But when viewed in Powerpoint my object has no background at all so 
other objects behind are visible.

Am I missing something?
Daniel
date: Mon, 11 Aug 2008 11:56:38 +0200   author:   Daniel Kirsch

Re: [Powerpoint] How to get a shape's background color?   
Daniel Kirsch wrote:
> I get the following values:
> Transparency : 0.0
> ForeColor : #00cc99
> BackColor : #ffffff
> TextureType : -2
> Pattern : -2

Type : 1 (msoFillSolid)

All these properties are identical for my objects no matter if they 
actually have a background color (ForeColor) or not.

I still havn't found a way to distinguish between objects with a colored 
background and no background (transparent).

Daniel
date: Mon, 11 Aug 2008 15:09:39 +0200   author:   Daniel Kirsch

Re: [Powerpoint] How to get a shape's background color?   
In article <g7pcnh$c76$01$1@news.t-online.com>, Daniel Kirsch wrote:
> Daniel Kirsch wrote:
> > I get the following values:
> > Transparency : 0.0
> > ForeColor : #00cc99
> > BackColor : #ffffff
> > TextureType : -2
> > Pattern : -2
> 
> Type : 1 (msoFillSolid)
> 
> All these properties are identical for my objects no matter if they 
> actually have a background color (ForeColor) or not.
> 
> I still havn't found a way to distinguish between objects with a colored 
> background and no background (transparent).

Again, the BackColor.RGB has no effect on anything UNLESS you've chosen a 
patterened fill type.

It's the .Transparency value that determines whether a fill is transparent or 
not and to what degree.

What puzzles me is that 00cc99 value.  I don't think that's legit.


--
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
date: Mon, 11 Aug 2008 10:41:17 EDT   author:   Steve Rindsberg

Re: [Powerpoint] How to get a shape's background color?   
Steve Rindsberg wrote:
> It's the .Transparency value that determines whether a fill is transparent or 
> not and to what degree.

I want to convert a slide into HTML. I don't mean opacity (which has a 
value from 0 to 1) but I mean the css color value "transparent" for the 
backgroundColor. Sorry for this confusion.

All my objects in the powerpoint presentation have a 
Shape.Fill.Transparency value of 0.0 both the ones with a solid fill 
color and those with no fill color (transparent in the CSS sense).


> What puzzles me is that 00cc99 value.  I don't think that's legit.

I think I've found the reason for this special value:
A shape's ForeColor property seems to inherit from the DefaultShape 
(Presentation.DefaultShape.Fill.ForeColor) At least the 00cc99 value is 
the DefaultShape's ForeColor value (well, the original value is 10079232 
which I convert to 00cc99).

When exporting to html from Powerpoint[1] the export contains the color 
values as well but transparent objects have an additional attribute
   filled="f"
which seems to cause the fillcolor not to be used.

Which Shape or Fill property could cause this filled attribute?

Thanks
Daniel


[1] Example of an exported transparent shape:

<v:shape
   id="_x0000_s24618"
   type="#_x0000_t202"
   style='position:absolute; left:168pt; top:258pt; width:468pt; 
height:84.25pt'
   filled="f"
   fillcolor="#0c9 [4]"
   stroked="f"
   strokecolor="black [1]">
</v:shape>
date: Mon, 11 Aug 2008 19:28:39 +0200   author:   Daniel Kirsch

Re: [Powerpoint] How to get a shape's background color?   
In article <g7prt3$vqj$00$1@news.t-online.com>, Daniel Kirsch wrote:
> Steve Rindsberg wrote:
> > It's the .Transparency value that determines whether a fill is transparent or 
> > not and to what degree.
> 
> I want to convert a slide into HTML. I don't mean opacity (which has a 
> value from 0 to 1) but I mean the css color value "transparent" for the 
> backgroundColor. Sorry for this confusion.
> 
> All my objects in the powerpoint presentation have a 
> Shape.Fill.Transparency value of 0.0 both the ones with a solid fill 
> color and those with no fill color (transparent in the CSS sense).
> 
> > What puzzles me is that 00cc99 value.  I don't think that's legit.

OK, back up then.  This is the first you've mentioned about HTML/CSS or that the 
values you're quoting are from HTML.  We're talking two entirely different 
languages here.  No wonder we're confused.  ;-)

> I think I've found the reason for this special value:
> A shape's ForeColor property seems to inherit from the DefaultShape 
> (Presentation.DefaultShape.Fill.ForeColor) At least the 00cc99 value is 
> the DefaultShape's ForeColor value (well, the original value is 10079232 
> which I convert to 00cc99).

When a new shape is created in PPT, it does inherit the presentation's defaults 
for new shapes, which include fill color and a host of other attributes, yes.

> When exporting to html from Powerpoint[1] the export contains the color 
> values as well but transparent objects have an additional attribute
>    filled="f"
> which seems to cause the fillcolor not to be used.
> 
> Which Shape or Fill property could cause this filled attribute?

I'm not seeing that here; have played with fills a good bit now and have yet to 
see filled="f" in any of the resulting HTML.

If you start with a blank presentation, add a single rectangle, what do you get?
If the filled=f appears, email me a copy at steve at-sign pptools dot com

> [1] Example of an exported transparent shape:
> 
> <v:shape
>    id="_x0000_s24618"
>    type="#_x0000_t202"
>    style='position:absolute; left:168pt; top:258pt; width:468pt; 
> height:84.25pt'
>    filled="f"
>    fillcolor="#0c9 [4]"
>    stroked="f"
>    strokecolor="black [1]">
> </v:shape>
>

--
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
date: Mon, 11 Aug 2008 16:41:33 EDT   author:   Steve Rindsberg

Re: [Powerpoint] How to get a shape's background color?   
Steve Rindsberg wrote:
> If you start with a blank presentation, add a single rectangle, what do you get?

The rectangle gets the default fill color. No filled="f" attribute.


> If the filled=f appears, email me a copy at steve at-sign pptools dot com

It appears for a second rectangle where I changed the fillcolor to "no 
filling".

The simple one slide test including the webexport can be found here:
www.birgin.de/test/ida/pp_test.zip

I'm currently using Powerpoint 2003.

Daniel
date: Tue, 12 Aug 2008 10:09:27 +0200   author:   Daniel Kirsch

Re: [Powerpoint] How to get a shape's background color?   
In article <g7rfgk$3dl$00$1@news.t-online.com>, Daniel Kirsch wrote:
> Steve Rindsberg wrote:
> > If you start with a blank presentation, add a single rectangle, what do you get?
> 
> The rectangle gets the default fill color. No filled="f" attribute.
> 
> > If the filled=f appears, email me a copy at steve at-sign pptools dot com
> 
> It appears for a second rectangle where I changed the fillcolor to "no 
> filling".
> 
> The simple one slide test including the webexport can be found here:
> www.birgin.de/test/ida/pp_test.zip

Thanks ... got it.

The filled="f" attribute appears when you choose No Fill for the shape.

PPT retains the fill color et al, but doesn't actually use it.
If you change the "f" to "t", the shape fills again.


--
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
date: Tue, 12 Aug 2008 11:22:56 EDT   author:   Steve Rindsberg

Re: [Powerpoint] How to get a shape's background color?   
Steve Rindsberg wrote:
> The filled="f" attribute appears when you choose No Fill for the shape.
> 
> PPT retains the fill color et al, but doesn't actually use it.
> If you change the "f" to "t", the shape fills again.

I found all that, but how do I get that info from a Shape or Shape.Fill 
object not the allready exported HTML?

I use an activeX instance, open the ppt file, and check a shape on a 
specified slide. However I cannot find the property that tells me that 
"No Fill" is chosen.

Steve, thanks a lot for your patience. :-)

Daniel
date: Tue, 12 Aug 2008 18:09:29 +0200   author:   Daniel Kirsch

Re: [Powerpoint] How to get a shape's background color?   
Daniel Kirsch wrote:
> I found all that, but how do I get that info from a Shape or Shape.Fill 
> object not the allready exported HTML?

Fill.Visible

Oh how simple is that!

Steve, your macro hint saved me another day. Thanks a lot.

Daniel
date: Tue, 12 Aug 2008 18:19:37 +0200   author:   Daniel Kirsch

Re: [Powerpoint] How to get a shape's background color?   
In article <g7sc7k$nf$03$1@news.t-online.com>, Daniel Kirsch wrote:
> Daniel Kirsch wrote:
> > I found all that, but how do I get that info from a Shape or Shape.Fill 
> > object not the allready exported HTML?
> 
> Fill.Visible
> 
> Oh how simple is that!
> 
> Steve, your macro hint saved me another day. Thanks a lot.

BadaBING. <g>

--
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
date: Tue, 12 Aug 2008 16:15:39 EDT   author:   Steve Rindsberg

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us