Share via


ScaleEffect.ToX Property

Sets or returns a Single that represents the ending width of a ScaleEffect object, specified as a percent of the screen width. Read/write.

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

Syntax

'Declaration
Property ToX As Single
    Get
    Set
'Usage
Dim instance As ScaleEffect
Dim value As Single

value = instance.ToX

instance.ToX = value
float ToX { get; set; }

Property Value

Type: System.Single
Single

Remarks

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.

Examples

The following example adds an animation path and sets the starting and ending horizontal and vertical positions.

Sub AddMotionPath()



    Dim effCustom As Effect

    Dim animMotion As AnimationBehavior

    Dim shpRectangle As Shape



    'Adds shape and sets effect and animation properties

    Set shpRectangle = ActivePresentation.Slides(1).Shapes _

        .AddShape(Type:=msoShapeRectangle, Left:=100, _

        Top:=100, Width:=50, Height:=50)

    Set effCustom = ActivePresentation.Slides(1).TimeLine.MainSequence _

        .AddEffect(Shape:=shpRectangle, effectId:=msoAnimEffectCustom)

    Set animMotion = effCustom.Behaviors.Add(msoAnimTypeMotion)



    'Sets starting and ending horizontal and vertical positions

    With animMotion.MotionEffect

        .FromX = 0

        .FromY = 0

        .ToX= 50

        .ToY = 50

    End With



End Sub

See Also

Reference

ScaleEffect Interface

ScaleEffect Members

Microsoft.Office.Interop.PowerPoint Namespace