How to implement disappearing animations in VBA?

Viewed 1746

I'm trying to test effect animations on shapes in a VBA procedure.

I've already achieved one which is adding some new animations in the MainSequence, defining in which position in the Timeline... but I am not able to create disapearing animations.

I checked in the beginning of the code some already there...and the EffectType seems to return the same value as related appearing animation, so that I sadly believe there's no way of creating disapearing animations in VBA.

Please tell me I am wrong, I have to do the same creations on over 300 slides...

3 Answers

Yes, you are wrong, however documentation to that is... well, I guess you know that already.

Here's the trick. To add a disappearing animation you have to add appearing animation but set it's 'Exit' property to 'msoTrue'

Take a look at this code example:

Private Sub SetAnimation()
    Dim effNewEffect As Effect

    With ActiveWindow.View.Slide
        Set effNewEffect = .TimeLine.MainSequence.AddEffect(.Shapes(.Shapes.Count), msoAnimEffectAppear, trigger:=msoAnimTriggerWithPrevious, Index:=-1)
    End With
    effNewEffect.Timing.TriggerDelayTime = 1.0
    effNewEffect.Exit = msoTrue
End Sub

It will add a Disappear animation to the last Shape in a current slide as the last in the MainSequence with delay 1.0 s to the previous animation.

Can't believe I have the answer to anything but here goes.

  1. Select object to disappear
  2. Go to animations an select fade out (red one)
  3. Open animation pane
  4. go to the click down menu for the object
  5. Select Effect options
  6. Go to timing menu
  7. Click triggers
  8. Click "start effect on click of" and find the object number that matches the one on the animation panel for it.
  9. Job done.
Related