Motioneffect Not working prperly!

G

Guest

Hi
I am trying to translate an object on to slide from one point(w.r.t percentage of screen Width ,height as given for powerpoint) to another

this is the code given on microsoft site
But its not working proporly.Object doesn't stop at all
Even if i add duration it doesn't effect

It seems that motioneffect is not working properly in powerpoint .I am Using powerpoint 200
It works for scaling and rotation

Dim shpNew As Shap
Dim effNew As Effec
Dim aniMotion As AnimationBehavio
shpNew = m_objPpt.ActivePresentation.Slides(1).Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShape5pointStar, Left:=0, Top:=0, Width:=100, Height:=100
effNew = m_objPpt.ActivePresentation.Slides(1).TimeLine.MainSequence.AddEffect(Shape:=shpNew, effectId:=PowerPoint.MsoAnimEffect.msoAnimEffectCustom,
Trigger:=PowerPoint.MsoAnimTriggerType.msoAnimTriggerWithPrevious
aniMotion = effNew.Behaviors.Add(MsoAnimType.msoAnimTypeMotion
effNew.Timing.Speed = 0.0
With aniMotion.MotionEffec
.FromX =
.FromY =
.ToX = 5
.ToY = 5
End Wit

Help me out

Thanks in advance.
 
S

Shyam Pillai

Anand,

Never rely on the code examples, they are not necessarily accurate
everytime.

' ------------------------------------'
' effNew.Timing.Speed = 0.02 ' Wrong property in use
' Use the duration property to set the duration
effNew.Timing.Duration = 2 ' In seconds
With aniMotion.MotionEffect
.FromX = 0
.FromY = 0
.ToX = 0.5 ' This has to be set a percentage of the slide
height and width, 50 is way too large a number
.ToY = 0.5 '
End With
' -------------------------------------'
Regards
Shyam Pillai

http://www.mvps.org/skp
 
J

John Langhans [MSFT]

[CRITICAL UPDATE - Anyone using Office 2003 should install the critical
update as soon as possible. From PowerPoint, choose "Help -> Check for
Updates".]
[TOP ISSUE - Are you having difficulty opening presentations in PPT 2003
that you just created in PPT 2003? -
http://support.microsoft.com/?id=329820]

Hello,

If you direct me to the source (page) of the incorrect sample code, I will
see that it gets corrected.

Thanks,

John Langhans
Microsoft Corporation
Supportability Program Manager
Microsoft Office PowerPoint for Windows
Microsoft Office Picture Manager for Windows

For FAQ's, highlights and top issues, visit the Microsoft PowerPoint
support center at: http://support.microsoft.com/default.aspx?pr=ppt
Search the Microsoft Knowledge Base at:
http://support.microsoft.com/default.aspx?pr=kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
S

Shyam Pillai

Hi John,
I see this in the several code snippets provided with the help files.

One such example:

MotionEffect Object

Example
Sub NewMotion()
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 ' While the code is correct, with such high values, you
won't even see the animation.
.ToY = 500 ' and no explanation is provided

End Sub

Regards
Shyam Pillai
 
G

Guest

Hi Shyam
Thanks a lot for your help

One thing more, what this speed in seconds means .They haven't given any explanation for that
I am not getting proper speed in my animations

Eagerly waiting for your valuable comment

regards
Anand
 
S

Shyam Pillai

Anand,
Use of the Duration property to set the duration for the Animation Effect.
The Speed property will always have a default value 1. This represents the
amount of time the animation will take to complete w.r.t to the duration.
For e.g if you set the duration to 1 second and the speed to 2 then the
animation will complete twice as fast. The value in the duration property is
what matters to PowerPoint to fire any AfterPrevious animations. So even if
the animation completes in half the time the AfterPrevious animation in the
queue will fire only after 1 second.

When Speed property is considered in case of a motion path and for the
Behavior object then a negative speed would indicate that path direction has
been reversed.

Another suggestion is: Instead of using the FromX, FromY, ToX and ToY
properties, create a VML motion path string and assign it to the Path
property. The manjor benefit is that then the user can edit the path in the
UI.

Regards
Shyam Pillai

http://www.mvps.org/skp
 

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

Similar Threads


Top