Applying Simultaneous Animations.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I m automating powerpoint. Programmtically, I have to add a rectangle to the
slide and then add two animations :Fly from left and Fade, to that
rectangle. I have been able to insert the rectangle but I can apply only one
animation at a time. I know that simulatenous animations won;t work for
PowerPoint earlier than 2002. I m using Powerpoint 2002. I have been able to
apply the two animations on the rectangle but in a consecutive manner...one
after another. But what I want is that the rectangle should fly fromleft and
at the same time fade in.

I m using VB.

Can anyone help me?

Thanks
 
Use the TimeLine object introduced with PowerPoint 2002 for this. For
example, the following subroutine adds a rectangle on a slide and applies Fly
from bottom and Fade effects on it. Both effects play simultaneously because
of msoAnimTriggerWithPrevious parameter applied to the second effect.

---
Sub AddAnimatedRectangle(ByVal Sld As Slide)
Dim Shp As Shape

Set Shp = Sld.Shapes.AddShape(msoShapeRectangle, 10, 10, 100, 100)
With Sld.TimeLine.MainSequence
.AddEffect(Shp, msoAnimEffectFly).Timing.Duration = 2
.AddEffect(Shp, msoAnimEffectFade, , _
msoAnimTriggerWithPrevious).Timing.Duration = 2
End With
End Sub
---

- Chirag

OfficeOne Animations - Add over 50 animation effects to PowerPoint
http://officeone.mvps.org/anims/anims.html
 
Here is sample code to do it.
' =============================================================
Sub CreateAnimation()
Dim oEffect As Effect
Dim oShpA As Shape
With ActivePresentation.Slides(1)
Set oShpA = .Shapes.AddShape(msoShapeRectangle, 100, 100, 100, 100)
With .TimeLine.MainSequence
' Fly in on mouse click
Set oEffect = .AddEffect(Shape:=oShpA, _
effectId:=msoAnimEffectFly, _
trigger:=msoAnimTriggerOnPageClick)
oEffect.Timing.Duration = 2 'Medium speed

' Fade in at the same time.
Set oEffect = .AddEffect(Shape:=oShpA, _
effectId:=msoAnimEffectFade, _
trigger:=msoAnimTriggerWithPrevious)
End With
End With
End Sub
' =============================================================
 

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

Back
Top