The VBA help for powerpoint 2007 is not very helpful on this subject.
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
--
Austin Myers
AT&W Technologies
Creators PowerPoint Add-Ins
www.playsforcertain.com
"D Riggins" <DRig...@discussions.microsoft.com> wrote in message
news:9B9C3621-49EE-48D1...@microsoft.com...
Sub IterateOverEffects()
Dim Eff As Effect
Dim I As Long
With ActivePresentation.Slides(1).TimeLine
For Each Eff In .MainSequence
If (Eff.EffectType >= msoAnimEffectPathCircle) And _
(Eff.EffectType <= msoAnimEffectPathRight) Then
' We have identified a motion path
For I = 1 To Eff.Behaviors.Count
If Eff.Behaviors(I).Type = msoAnimTypeMotion Then
' Use Eff.Behaviors(I).MotionEffect property
End If
Next
End If
Next
End With
End Sub
- Chirag
PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
"D Riggins" <DRig...@discussions.microsoft.com> wrote in message
news:9B9C3621-49EE-48D1...@microsoft.com...
Guess I should be careful what I wish for. Looks like the Motion paths are
defined not with begin/end points but as movements expressed in fractions of
the slide size.
VML path for circle animation is:
M 0 0 C 0.069 0 0.125 0.07467 0.125 0.16667 C 0.125 0.25867 0.069
0.33333 0 0.33333 C -0.069 0.33333 -0.125 0.25867 -0.125 0.16667
C -0.125 0.07467 -0.069 0 0 0 Z
M indicates Move To a point, the begining of the path.
Z indicates that it is a closed path. If final co-ordinate is not the same
as the first, then you should close the path.
C Bezier curver
L Line
The above string has 4 bezier curves co-ordinates required to draw the
circle.
(0, 0) C (0.069, 0) (0.125, 0.07467) (0.125, 0.16667)
(0.125, 0.16667) C (0.125, 0.25867) (0.069, 0.33333) (0, 0.33333)
(0.069, 0.33333) (0, 0.33333) C (-0.069, 0.33333) (-0.125, 0.25867)
(-0.125, 0.16667)
(-0.125, 0.16667) C (-0.125,0.07467) (-0.069, 0) (0, 0)
Capital alphabhets represent absolute values with respect to shapes. 0,0
represents the centre of the shape.
For X co-ordinate multiply the value with 720 and for Y co-ordinate multiple
with 540 to get the value in points. If the VML values are absolute then you
will now need to account for the shapes position on the slide and perform
the calculations to arrive at the actual positions on the screen.
Regards,
Shyam Pillai
Image Importer Wizard: http://skp.mvps.org/iiw.htm
"D Riggins" <DRig...@discussions.microsoft.com> wrote in message
news:9B9C3621-49EE-48D1...@microsoft.com...
Shyam, would it always be 720/540 or would it vary depending on
ActivePresentation.PageSetup.SlideHeight / .SlideWidth?
I'm guessing the latter.
Regards,
Shyam Pillai
Handout Wizard: http://skp.mvps.org/how
"Steve Rindsberg" <ab...@localhost.com> wrote in message
news:VA.00004dd...@localhost.com...
Thanks ... I figured that it pretty much had to be thataway.
>
> Regards,
> Shyam Pillai
>
> Handout Wizard: http://skp.mvps.org/how
>
> "Steve Rindsberg" <ab...@localhost.com> wrote in message
> news:VA.00004dd...@localhost.com...
> >
> >> Capital alphabhets represent absolute values with respect to shapes. 0,0
> >> represents the centre of the shape.
> >> For X co-ordinate multiply the value with 720 and for Y co-ordinate
> >> multiple
> >> with 540 to get the value in points.
> >
> > Shyam, would it always be 720/540 or would it vary depending on
> > ActivePresentation.PageSetup.SlideHeight / .SlideWidth?
> >
> > I'm guessing the latter.
> >
> >
> >
==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/
PPTools add-ins for PowerPoint
http://www.pptools.com/