ToY 属性

       

返回或设置 Single 类型值,该值分别代表 ScaleEffectMotionEffect 对象的最终高度或垂直位置,其值以屏幕宽度的百分比形式表示。可读写。

expression.ToY

expression  必选。该表达式返回“应用于”列表中的对象之一。

说明

此属性的默认值为 Empty,此情况下使用对象的当前位置。

将此属性与 FromY 属性联合使用以便调整大小或从一个位置跳到另一个位置。

请勿将此属性与 ColorEffectRotationEffectPropertyEffect 对象的 To 属性相混淆,后者分别用于设置或更改动画动作的颜色、旋转或其他属性。

示例

以下示例添加一个动画路径并且设置起始和结束的水平和垂直位置。

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