'declare Variables
Dim osld As Slide
Dim oshp As Shape
Dim oeff As Effect
' SET objects
Set osld = ActivePresentation.Slides(7)
Set oshp = osld.Shapes("Star 1")
Set oeff = osld.TimeLine.MainSequence.AddEffect(Shape:=oshp, effectid:=msoAnimEffectChangeFillColor)
With oeff
.EffectParameters.Color2.RGB = RGB(Red:=10, Green:=45, Blue:=201)
.Timing.Duration = 2
End With
oshp.Left = oshp.Left + 100 ' Added to verify something was coming thru!
Sadly it still doesn’t work… It compiles, but no effect on the slide…
I’ve updated the code to show your recommendations
NB: The fill color is defined at the creation of the shape
I added a + 100 to the left value of the shape just to make sure it was actually getting thru, it does move but it won’t change color…
Is there an “official” list somewhere of what effects support what parameters?
Thanks for slugging thru this with me! 🙂
I understand your frustration: As mentioned in my comment, the
Color1property does not exist in PowerPoint 2010, yet the example given in the documentation forColor2does useColor1— and, as a result, it doesn’t compile!The correct way is to give the shape a color, like this:
This will be the starting color. The animation effect can then change that color:
Note that
Timingis a property ofEffect, not ofEffectParametersas in the code given in your question.