Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / June 2007

Tip: Looking for answers? Try searching our database.

PPT2007. VBA. Add Motion Path Effect to a Shape

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KL - 25 Jun 2007 16:32 GMT
Hi there,

Can anyone share a VBA code snippet for adding Motion Path to a shape in PPT2007 please? This one (slightly adjusted) works in
PPT2003, but not in PPT2007:
http://msdn2.microsoft.com/en-us/library/aa201181(office.10).aspx

Thanks and regards,
Signature

KL
[MVP - Microsoft Excel]
RU: http://www.mvps.ru/Program/Default.aspx
ES: http://mvp.support.microsoft.com/?LN=es-es
EN: http://mvp.support.microsoft.com/?LN=en-us
Profile: http://mvp.support.microsoft.com/profile/Kirill

Shyam Pillai - 29 Jun 2007 03:33 GMT
That's broken in PPT 2007. Instead use the more reliable way of setting the
motion path by specifying a VML string containing the co-ordinates.

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
      .Path = "M 0 0  L -0.25 0  E"
   End With

End Sub

Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm

> Hi there,
>
[quoted text clipped - 4 lines]
>
> Thanks and regards,
KL - 29 Jun 2007 20:46 GMT
Hi Shyam,

> That's broken in PPT 2007. Instead use the more reliable way of setting the motion path by specifying a VML string containing the
> co-ordinates.
[quoted text clipped - 18 lines]
>
> End Sub

Thank you very much, I have already found a thread in another forum where you gave this advice to someone else and it worked nicely
for me.

Reagrds,

Signature

KL
[MVP - Microsoft Excel]
RU: http://www.mvps.ru/Program/Default.aspx
ES: http://mvp.support.microsoft.com/?LN=es-es
EN: http://mvp.support.microsoft.com/?LN=en-us
Profile: http://mvp.support.microsoft.com/profile/Kirill

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.