Share via


MotionEffect Interface

Represents a motion effect for an AnimationBehavior object.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
<GuidAttribute("914934E5-5A91-11CF-8700-00AA0060263B")> _
Public Interface MotionEffect
'Usage
Dim instance As MotionEffect
[GuidAttribute("914934E5-5A91-11CF-8700-00AA0060263B")]
public interface MotionEffect

Examples

Use the MotionEffect propety of the AnimationBehavior object to return a MotionEffect object. The following example refers to the motion effect for a given animation behavior.

ActivePresentation.Slides(1).TimeLine.MainSequence.Item.Behaviors(1).MotionEffect

Use the ByX , ByY , FromX , FromY , ToX , and ToY properties of the MotionEffect object to construct a motion path. The following example adds a shape to the first slide and creates a motion path.

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

See Also

Reference

MotionEffect Members

Microsoft.Office.Interop.PowerPoint Namespace