Class MotionEffect (PowerPoint VBA)

The class MotionEffect represents a motion effect for an AnimationBehavior object. To use a MotionEffect class variable it first needs to be instantiated, for example


Dim met as MotionEffect
Set met = ActivePresentation.SlideMaster.TimeLine.MainSequence(1).Behaviors(1).MotionEffect

ByX

Sets or returns a Single that represents scaling or moving an object horizontally by a specified percentage of the screen width, depending on whether it used in conjunction with a ScaleEffect or MotionEffect object, respectively. For example, a value of 50 for a motion effect means to move the object half the screen width to the right.

Negative numbers move the object horizontally to the left. Floating point numbers (for example, 55.5) are allowed. To scale or move an object vertically, use the ByY property. If both the ByX and ByY properties are set, then the object is scaled or moves both horizontally and vertically. Do not confuse this property with the By property of the ColorEffect, RotationEffect, or PropertyEffect objects, which is used to set colors, rotations, or other properties of an animation behavior, respectively.


ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).MotionEffect.ByX = 50

ByY

Sets or returns a Single that represents scaling or moving an object VERTICALLY by a specified percentage of the screen width, depending on whether it is used in conjunction with a ScaleEffect or MotionEffect object, respectively.

Negative numbers move the object horizontally to the left. Floating point numbers (for example, 55.5) are allowed. To scale or move an object horizontally, use the ByX property. If both the ByX and ByY properties are set, then the object is scaled or moves both horizontally and vertically. Do not confuse this property with the By property of the ColorEffect, RotationEffect, or PropertyEffect objects, which is used to set colors, rotations, or other properties of an animation behavior, respectively.


ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).MotionEffect.ByY = 50

FromX

Sets or returns a Single that represents the starting width or horizontal position of a MotionEffect object, specified as a percent of the screen width.

The default value of this property is Empty, in which case the current position of the object is used. Use this property in conjunction with the ToX property to resize or jump from one position to another. Do not confuse this property with the From property of the ColorEffect, RotationEffect, or PropertyEffect objects, which is used to set or change colors, rotations, or other properties of an animation behavior, respectively.


ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).MotionEffect.FromX =

FromY

Returns or sets a Single that represents the vertical position of a MotionEffect object, specified as a percentage of the screen width.

The default value of this property is Empty, in which case the current position of the object is used. Use this property in conjunction with the ToY property to resize or jump from one position to another. Do not confuse this property with the From property of the ColorEffect, RotationEffect, or PropertyEffect objects, which is used to set or change colors, rotations, or other properties of an animation behavior, respectively.


ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).MotionEffect.FromY =

Path

Returns a String that represents the path followed by a MotionEffect object.

The String returned for a MotionEffect object is a specific path that the motion effect follows between From and To, using the same syntax as the VML path description.


ActivePresentation.SlideMaster.TimeLine.MainSequence(1).Behaviors(1).MotionEffect.Path =

ToX

Sets or returns a Single that represents the horizontal position of a MotionEffect object, specified as a percent of the screen width.

The default value of this property is Empty, in which case the current position of the object is used. Use this property in conjunction with the FromX property to resize or jump from one position to another. Do not confuse this property with the To property of the ColorEffect, RotationEffect, or PropertyEffect objects, which is used to set or change colors, rotations, or other properties of an animation behavior, respectively.


ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).MotionEffect.ToX = 100

ToY

Returns or sets a Single that represents the vertical position of a MotionEffect object, specified as a percentage of the screen width.

The default value of this property is Empty, in which case the current position of the object is used. Use this property in conjunction with the FromY property to resize or jump from one position to another. Do not confuse this property with the To property of the ColorEffect, RotationEffect, or PropertyEffect objects, which is used to set or change colors, rotations, or other properties of an animation behavior, respectively.


ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).MotionEffect.ToY = 100