次の方法で共有


MotionEffect.FromX プロパティ (PowerPoint)

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

構文

FromX

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

戻り値

1 行

注釈

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

サイズを変更したり、別の位置にジャンプする、 ToX プロパティと組み合わせてこのプロパティを使用します。

プロパティを使用して から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 のサポートおよびフィードバックを参照してください。