ScaleEffect.FromX 属性 (PowerPoint)

设置或返回 一个 表示起始宽度或屏幕宽度的百分比形式指定的 ScaleEffect 对象的水平位置。 读/写。

语法

expressionFromX

表达 一个代表 ScaleEffect 对象的变量。

返回值

单精度

备注

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

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

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

示例

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

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 支持和反馈,获取有关如何接收支持和提供反馈的指南。