MotionEffect オブジェクト (PowerPoint)
AnimationBehavior オブジェクトのアニメーション効果を表します。
例
AnimationBehavior オブジェクトの MotionEffect プロパティを使用して、MotionEffect オブジェクトを取得します。 次の使用例は、指定したアニメーション動作の効果を参照します。
ActivePresentation.Slides(1).TimeLine.MainSequence.Item.Behaviors(1).MotionEffect
MotionEffect オブジェクトのByX 、ByY 、FromX 、FromY 、ToX 、およびToYプロパティを使用すると、アニメーションの軌跡を作成できます。 おもちゃ と ToX プロパティは、割合では、 ToX 1.0 はスライドの幅と おもちゃ の 100% を = 1.0 はスライドの高さを 100% を = します。 次の使用例は、最初のスライドに図形を追加し、アニメーションの軌跡を作成します。
Sub AddMotionPath()
Dim shpNew As Shape
Dim effNew As Effect
Dim aniMotion As AnimationBehavior
Set shpNew = ActivePresentation.Slides(1).Shapes _
.AddShape(Type:=msoShape5pointStar, Left:=0, _
Top:=0, Width:=100, Height:=100)
Set effNew = ActivePresentation.Slides(1).TimeLine.MainSequence _
.AddEffect(Shape:=shpNew, effectId:=msoAnimEffectCustom, _
Trigger:=msoAnimTriggerWithPrevious)
Set aniMotion = effNew.Behaviors.Add(msoAnimTypeMotion)
With aniMotion.MotionEffect
.FromX = 0
.FromY = 0
.ToX = .5
.ToY = .5
End With
End Sub
関連項目
PowerPoint Object Model Reference
サポートとフィードバック
Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。