FromY 属性

       

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

expression.FromY

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

说明

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

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

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

示例

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

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