Hi, what would the code be for a macro to change the animation of a selected item to flying in and change the speed to 1 second.
Thanks!
Printable View
Hi, what would the code be for a macro to change the animation of a selected item to flying in and change the speed to 1 second.
Thanks!
This assumes that the selected shape is already animated and it's the first animation you want to change:
To ADD the effect to an unanimated shape change the 'set oeff' line toCode:Sub change_to_fly()
Dim oshp As Shape
Dim osld As Slide
Dim oeff As Effect
On Error Resume Next
Set oshp = ActiveWindow.Selection.ShapeRange(1)
If Not oshp Is Nothing Then
Set osld = oshp.Parent
Set oeff = osld.TimeLine.MainSequence.FindFirstAnimationFor(oshp)
With oeff
.EffectType = msoAnimEffectFly
.EffectParameters.Direction = msoAnimDirectionLeft
.Timing.Duration = 0.25
End With
End If
End Sub
Set oeff = osld.TimeLine.MainSequence.AddEffect(oshp, msoAnimEffectFly, , msoAnimTriggerOnPageClick)