PDA

View Full Version : Change Font Color animation not working properly



Jhon90
01-08-2023, 05:48 AM
Sir Need some help..
I want to use change font color animation in my project so that text color change from white to green.
But it don't work all times and sometimes changed to orange color instead of green. I search web a lot & do not find correct answer.
When analysis I found that most of the time after running the code it turns to orange but when check with vba code the color code shows its green.
I think powerpoint sometimes not able to update the color after running the code. So how can I get desire result i.e. changed to green color.
Any solution will be highly appreciate.
The code I have tried:



Sub changeColor()


Dim osld As Slide
Dim shpTop As Shape
Dim oeff As Effect
Set osld = ActivePresentation.Slides(1)
Set shpTop = osld.Shapes("Text_1")
Set oeff = osld.TimeLine.MainSequence.AddEffect(Shape:=shpTop, effectid:=msoAnimEffectChangeFontColor, trigger:=msoAnimTriggerNone)
oeff.EffectParameters.Color2 = RGB(0, 255, 0)
oeff.Timing.TriggerType = msoAnimTriggerWithPrevious
oeff.Timing.TriggerDelayTime = 1
oeff.Timing.Duration = 0.5


End Sub

John Wilson
01-12-2023, 03:00 PM
Your code works for me BUT ....

If you use ChangeFontColor manually you can set the effect to be NOT cycle through another color before going green. In code as far as I know you cannot specify this. Why not try the Brush On Color effect instead?


Sub changeColor()
Dim osld As Slide
Dim shpTop As Shape
Dim oeff As Effect
Set osld = ActivePresentation.Slides(1)
Set shpTop = osld.Shapes("Text_1")
Set oeff = osld.TimeLine.MainSequence.AddEffect(Shape:=shpTop, effectid:=msoAnimEffectBrushOnColor, trigger:=msoAnimTriggerWithPrevious)
oeff.EffectParameters.Color2 = RGB(0, 255, 0)
oeff.Timing.TriggerDelayTime = 1
oeff.Timing.Duration = 0.5
End Sub

Jhon90
01-13-2023, 03:52 AM
Thanks Sir, You save me lot of time & I lost hope to implement those animation but you give what a easy solution. May god bless you.

Jhon90
01-15-2023, 02:35 AM
Sir, now got the same problem i.e. change to default color when we repeat the code. Any other solution sir. Because I need to change color after animation. Thanks in advance.