PowerPoint) (效果对象
代表有关幻灯片动画的计时信息。
示例
使用 AddEffect 方法添加效果。 本示例向当前演示文稿第一张幻灯片添加一个形状并向形状中添加一种效果和行为。
Sub NewShapeAndEffect()
Dim shpStar As Shape
Dim sldOne As Slide
Dim effNew As Effect
Set sldOne = ActivePresentation.Slides(1)
Set shpStar = sldOne.Shapes.AddShape(Type:=msoShape5pointStar, _
Left:=150, Top:=72, Width:=400, Height:=400)
Set effNew = sldOne.TimeLine.MainSequence.AddEffect(Shape:=shpStar, _
EffectId:=msoAnimEffectStretchy, Trigger:=msoAnimTriggerAfterPrevious)
With effNew
With .Behaviors.Add(msoAnimTypeScale).ScaleEffect
.FromX = 75
.FromY = 75
.ToX = 0
.ToY = 0
End With
.Timing.AutoReverse = msoTrue
End With
End Sub
若要引用现有的 Effect 对象,请使用 MainSequence (index) 方法,其中 index 是 Sequence 集合中 Effect 对象的编号。 本示例更改第一个序列的效果,并指定为该效果的行为。
Sub ChangeEffect()
With ActivePresentation.Slides(1).TimeLine _
.MainSequence(1)
.EffectType = msoAnimEffectSpin
With .Behaviors(1).RotationEffect
.From = 100
.To = 360
.By = 5
End With
End With
End Sub
方法
名称 |
---|
Delete |
MoveAfter |
MoveBefore |
MoveTo |
属性
名称 |
---|
Application |
行为 |
DisplayName |
EffectInformation |
EffectParameters |
EffectType |
Exit |
索引 |
Paragraph |
Parent |
形状 |
TextRangeLength |
TextRangeStart |
时间 |
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。