AnimationBehavior![]() |
代表 AnimationBehavior 对象的旋转效果。
使用 AnimationBehavior 对象的 RotationEffect 属性返回 RotationEffect 对象。以下示例引用了给定动画动作的旋转效果。
ActivePresentation.Slides(1).TimeLine.MainSequence.Item.Behaviors(1).RotationEffect
使用 RotationEffect 对象的 By、From 和 To 属性影响对象的动画旋转。以下示例向第一张幻灯片添加新的形状并设置旋转动画动作。
Sub AddRotation()
Dim shpNew As Shape
Dim effNew As Effect
Dim aniNew 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)
Set aniNew = effNew.Behaviors.Add(msoAnimTypeRotation)
With aniNew.RotationEffect
'Rotate 270 degrees from current position
.By = 270
End With
End Sub