I am trying to script an animation. One of the things I want to do is change the font color. So I wrote this (not including the error handling):
Set sld = Application.ActiveWindow.View.Slide
For i = 1 To sld.TimeLine.MainSequence.Count
sld.TimeLine.MainSequence.Item(1).Delete
Next i
Set shp = sld.Shapes.Placeholders(2)
nParagraphs = shp.TextFrame.TextRange.Paragraphs.Count
sld.TimeLine.MainSequence.AddEffect Shape:=shp, effectid:=msoAnimEffectChangeFontColor, Level:=msoAnimateTextByFirstLevel, trigger:=msoAnimTriggerOnPageClick
For j = 1 To nParagraphs
Set eff = sld.TimeLine.MainSequence.Item(j)
eff.EffectParameters.Color2.RGB = RGB(200, 200, 200)
eff.Timing.SmoothEnd = msoFalse
eff.Timing.duration = 0.5
Next j
First I remove all animation on the slide, and then add the one that should do the font change. As there are more than 1 bullet in the placeholder, this creates more than one animation. So I loop over the effects and set the properties for each effect.
However, if I have more than two paragraphs (or bullets) the first two turn gray but the third and fourth and so on, have color2 set to a reddish value.
Why is that?
UPDATE: I changed it from a macro in a pptm file, to a C# Office Add-In and then it works as expected.
eff.EffectParameters.Color2 = Color.FromArgb(200, 200, 200);