Log in

View Full Version : [SOLVED:] Replacing one animation type by another using VBA



isabelle r
08-05-2019, 07:42 AM
Hi all,

I'm working on converting a number of my PPT presentations to HTML5 for use online, but unfortunately the programme used for the conversion doesn't support the "Blink" emphasis animation which I use quite extensively (I know it's ugly, but I need it as it's used to flash a rectangle to attract attention in screenshots with a very busy interface).

Anyway, after consulting with the tech support of the conversion software, keeping the blink animation would need a lot of manual work (basically emulating it with appear-disappear), so I decided to replace it with the "Pulse" animation instead, which is supported by the software.

As the animation is used extensively, replacing blink by pulse would require a lot of mind-numbingly repetitive manual work, with a risk of errors slipping in there as well, so I was wondering if there is a simple way of using VBA to search through every slide, find the "Blink" animation, and replace it with the "Pulse" animation (in the same place in the timeline, if possible using the same duration and number of repeats).

If anyone could help me here, you'd be making my life a lot easier, and my August being locked in the office slightly more pleasant :)

Thank you in advance,

-Isa

John Wilson
08-06-2019, 12:30 AM
Blink is a strange animation and has odd properties (probably why it doesn't convert.)

Try this but use a copy!



Sub relaceAni()
Dim osld As Slide
Dim oeff As Effect
Dim L As Long
For Each osld In ActivePresentation.Slides
For L = 1 To osld.TimeLine.MainSequence.Count
Set oeff = osld.TimeLine.MainSequence(L)
On Error Resume Next
Err.Clear
Debug.Print oeff.EffectType
If Err <> 0 Then
osld.TimeLine.MainSequence(L).EffectType = 75
End If
Next L
Next osld
End Sub

isabelle r
08-06-2019, 01:12 AM
John, it works perfectly, as always.

I can't count the number of times you've saved me hours of tedious work here. I'm very grateful for your help, thank you.

-Isa