Header

PowerPoint tips, hints and tutorials that will change your presentations for ever!

INDEX

 

Jigsaws
Sounds
Video
Custom Shows
vba code
NaviSlides
Games for teachers
Bullets
Triggers
Security
Flash Cards
Multiple Instances
PowerPoint 2007
Mail Merge
Random events
Animation
Hyperlinks
Set spellcheck language


Home buttonTutorial buttonContact buttonProducts button


vba Animation from PowerPoint XP Onwards

The animation engine changed dramatically in PowerPoint XP. To add or modify animations you should use the Timeline.

This example adds a star and animates it.

Sub add_animshape()
Dim oshp As Shape
Dim osld As Slide
Dim oeff As Effect
Set osld = ActivePresentation.Slides(1)
'add star at position 10,10 size 100 x 100
Set oshp = osld.Shapes.AddShape(msoShape10pointStar, 10, 10, 100, 100)
Set oeff = osld.TimeLine.MainSequence.AddEffect _
(Shape:=oshp, effectid:=msoAnimEffectWipe, trigger:=msoAnimTriggerOnPageClick)
'From left, medium speed (2 secs)
With oeff
.EffectParameters.Direction = msoAnimDirectionLeft
.Timing.Duration = 2
End With
End Sub

To create an EXIT animation modify to:

With oeff
.EffectParameters.Direction = msoAnimDirectionLeft
.Timing.Duration = 2
.Exit = msoTrue 'add this line for an exit animation
End With

Don't know how to use this code?

 
 

Back to the Index Page

POWERPOINT BLOG

Articles on your favourite sport

Free Microsoft PowerPoint Advice, help and tutorials, Template Links
This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175
PowerPoint® is a registered trademark of the Microsoft Corporation