共用方式為


PowerPoint) (ScaleEffect.ByY 屬性

設定或傳回 單一 代表調整或移動物件垂直的螢幕寬度,根據是否使用搭配 ScaleEffectMotionEffect 物件,分別指定百分比。 讀取/寫入。

語法

expressionByY

表達 代表 ScaleEffect 物件的 變數。

傳回值

單一

註解

負數會向左水平移動物件。 可以使用浮點數 (例如,55.5)。

若要擴充或水平移動物件,請使用 ByX 屬性。

如果設定 ByXByY 屬性物件調整或移動水平和垂直方向。

請勿將這個屬性與 ColorEffectRotationEffectPropertyEffect 物件屬性是用來分別設定色彩、 旋轉或其他動畫行為的屬性。

範例

在下列範例中,會新增動畫路徑;然後設定圖案的水平及垂直移動方式。

Sub AddMotionPath()

    Dim effCustom As Effect
    Dim animBehavior As AnimationBehavior
    Dim shpRectangle As Shape

    'Adds rectangle and sets effect and animation
    Set shpRectangle = ActivePresentation.Slides(1).Shapes _
        .AddShape(Type:=msoShapeRectangle, Left:=300, _
        Top:=300, Width:=300, Height:=150)

    Set effCustom = ActivePresentation.Slides(1).TimeLine _
        .MainSequence.AddEffect(Shape:=shpRectangle, _
         effectId:=msoAnimEffectCustom)

    Set animBehavior = effCustom.Behaviors.Add(msoAnimTypeMotion)

    'Specifies animation motion
    With animBehavior.MotionEffect
        .ByX = 50
        .ByY = 50
    End With

End Sub

另請參閱

ScaleEffect 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應