次の方法で共有


MotionEffect.ToX プロパティ (PowerPoint)

設定または取得する 1 つ を画面の幅に対する割合として指定された、 MotionEffect オブジェクトの水平方向の位置を表します。 値の取得と設定が可能です。

構文

ToX

MotionEffect オブジェクトを表す変数。

戻り値

1 行

注釈

このプロパティの既定値は、 である場合、オブジェクトの現在の位置が使用されています。

FromX プロパティと共にサイズを変更したり、1 つの位置から別にジャンプするのにはこのプロパティを使用します。

このプロパティ は、 ColorEffectRotationEffect 、または 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

関連項目

MotionEffect オブジェクト

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。