Solved

Copying a PowerPoint slide background gradient's brightness using Insert2 method of VBA

Posted on 2014-12-11
2
237 Views
Last Modified: 2014-12-11
I need to copy the gradient of a slide's background fill from one slide to another.

The properties of the source gradient may be read as follows:

Function ShowGradientProperties(oSld as Slide)
  Dim counter as Integer
  With oSld.Background.Fill.GradientStops
    For counter = 1 to .Count
      Debug.Print counter, .Item(counter).Color
      Debug.Print counter, .Item(counter).Position
      Debug.Print counter, .Item(counter).Transparency
    Next
  End With
End Function

Open in new window


Now, when copying gradient properties, the gradient has to be added first using the GradientStops.Insert method. PowerPoint 2010 added a second Insert2 method which added the Brightness property for each gradient stop.

oSld.Background.Fill.GradientStops.Insert2 RGB, Position, [Transparency], [Index], [Brightness]

Open in new window


But, Brightness is not available in the slide's GradientStops object model so how is it possible to read the source gradient's Brightness?
0
Comment
Question by:Jamie Garroch
2 Comments
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40493596
Hi,

pls try

      Debug.Print counter, .Item(counter).Color.RGB
      Debug.Print counter, .Item(counter).Color.Brightness
      Debug.Print counter, .Item(counter).Position
      Debug.Print counter, .Item(counter).Transparency

Regards
0
 
LVL 10

Author Comment

by:Jamie Garroch
ID: 40493705
That works thank you Rgonzo1971. It's an odd place for the property but it's an odd property because if you set the color and then set the brightness, the color is changed! So, to copy a gradient stop, one first needs to set the brightness of the source stop to 0 before reading the color!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting the Scene Animations in PowerPoint are a great tool to convey messages when used carefuly with the content of your slides. There are plenty of animation effects and options, including a Repeat feature for individual animation effects. …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This video teaches viewers how to fit pictures into slides, crop and remove backgrounds, and alter photos to look more professional.

815 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

11 Experts available now in Live!

Get 1:1 Help Now