R
ristmi
I'm trying to create a custom motion path for a shape in Powerpoint
(Office Powerpoint 2003 - 11.8110.8107 SP2) using VBA code. However, if
I copy sample code from MSDN, such as...
Sub AddMotionPath()
Dim shpNew As Shape
Dim effNew As Effect
Dim aniMotion As AnimationBehavior
Set shpNew = ActivePresentation.Slides(1).Shapes _
.AddShape(Type:=msoShape5pointStar, Left:=0, _
Top:=0, Width:=100, Height:=100)
Set effNew = ActivePresentation.Slides(1).TimeLine.MainSequence _
.AddEffect(Shape:=shpNew, effectId:=msoAnimEffectCustom, _
Trigger:=msoAnimTriggerWithPrevious)
Set aniMotion = effNew.Behaviors.Add(msoAnimTypeMotion)
With aniMotion.MotionEffect
.FromX = 0
.FromY = 0
.ToX = 500
.ToY = 500
End With
End Sub
.... I just end up with a shape (5 point start obviously) on my slide
that has a custom animation property (i.e. Modify: Custom) but no
motion path (i.e. the shape has no motion/animation effects).
Any ideas why the MSDN codes does not work for me? Thanks in advance.
(Office Powerpoint 2003 - 11.8110.8107 SP2) using VBA code. However, if
I copy sample code from MSDN, such as...
Sub AddMotionPath()
Dim shpNew As Shape
Dim effNew As Effect
Dim aniMotion As AnimationBehavior
Set shpNew = ActivePresentation.Slides(1).Shapes _
.AddShape(Type:=msoShape5pointStar, Left:=0, _
Top:=0, Width:=100, Height:=100)
Set effNew = ActivePresentation.Slides(1).TimeLine.MainSequence _
.AddEffect(Shape:=shpNew, effectId:=msoAnimEffectCustom, _
Trigger:=msoAnimTriggerWithPrevious)
Set aniMotion = effNew.Behaviors.Add(msoAnimTypeMotion)
With aniMotion.MotionEffect
.FromX = 0
.FromY = 0
.ToX = 500
.ToY = 500
End With
End Sub
.... I just end up with a shape (5 point start obviously) on my slide
that has a custom animation property (i.e. Modify: Custom) but no
motion path (i.e. the shape has no motion/animation effects).
Any ideas why the MSDN codes does not work for me? Thanks in advance.