PowerPoint) (ScaleEffect.ToY 属性

返回或设置 一个 表示结束为屏幕宽度的百分比指定的 ScaleEffect 对象的高度。 读/写。

语法

expression。 ToY

表达式 表示 ScaleEffect 对象的变量。

返回值

单精度

备注

此属性的默认值为 空 ,在其中使用用例对象的当前位置。

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

不要混淆此属性与 To 属性 ColorEffect , RotationEffect 或 PropertyEffect 的对象,用于设置或更改颜色、 循环或其他属性的动画动作,分别。

示例

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

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

另请参阅

ScaleEffect 对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。