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 / April 2007

Tip: Looking for answers? Try searching our database.

Background color

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zidansoft@gmail.com - 16 Apr 2007 14:14 GMT
How i can get individual slide background through automation if
background is gradient ?
                       CShapeRange range=slide.get_Background();
           CFillFormat fill= range.get_Fill();
           clrF  =fill.get_BackColor();
giving correct result if solid color,but gradient  or pic always
giving  default color .
i tried  win32 call getPixel but i can't ensure that specific pixel
text or background.
I need at least one pixel color which belong to exact  background.
Steve Rindsberg - 16 Apr 2007 15:32 GMT
> How i can get individual slide background through automation if
> background is gradient ?
[quoted text clipped - 6 lines]
> text or background.
> I need at least one pixel color which belong to exact  background.

This is one of those cases where the macro recorder will give you almost
exactly what you need (assuming you're using 2003 or earlier).

Sub Macro1()
   With ActiveWindow.Selection.ShapeRange
       .Fill.Transparency = 0#
       .Fill.Visible = msoTrue
       
  ' These are the properties you need:
       .Fill.ForeColor.RGB = RGB(0, 0, 255)
       .Fill.BackColor.RGB = RGB(255, 0, 0)
       
       .Fill.TwoColorGradient msoGradientHorizontal, 2
   End With
End Sub

You'd first want to test the shape's .Fill.Type to determine whether it's a
gradient or not.

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

Rate this thread:






 
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



©2008 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.