Activating animation using VBA

K

Klarissa

I am trying to apply animation to a slide or to turn off animation on a slide
using VBA or to determine animation status of specific slide but am stuck.
Any ideas on how to achieve this?
 
S

Shyam Pillai

Klarissa,
You can assign an animation in PPT 2002 and later using the following code:
Sub CreateAnimation()
Dim oEffect As Effect
Dim oShpA As Shape
With ActivePresentation.Slides(1)
'Create two autoshapes on the slide.
Set oShpA = .Shapes.AddShape(msoShapeRectangle, 100, 100, 50, 50)
' Assign an animation to shape A
Set oEffect = .TimeLine.MainSequence.AddEffect(Shape:=oShpA,
effectId:=msoAnimEffectAppear)
End With
End Sub


To assign an interactive animation take a look at the code here:
http://skp.mvps.org/pptxp012.htm#interactive

You can turn off the animations on the slides but this applies to the
presentation as a whole and not specific slides. Look at the
slideshowsetting - ShowWithAnimation property to address this.

To determine the animation status you need to setup an event hook to track
the animations as they fire. Look on my site for a downloadable example of
eventhandler in PowerPoint http://skp.mvps.org/download.htm


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top