返回或设置 Single 数值,该值代表以秒为单位的动画长度。可读写。
expression.Duration
expression 必选。该表达式返回“应用于”列表中的对象之一。
以下示例添加一个形状并对该形状添加动画,然后设置该动画的持续时间。
Sub AddShapeSetTiming()
Dim effDiamond As Effect
Dim shpRectangle As Shape
'Adds shape and sets animation effect
Set shpRectangle = ActivePresentation.Slides(1).Shapes _
.AddShape(Type:=msoShapeRectangle, Left:=100, _
Top:=100, Width:=50, Height:=50)
Set effDiamond = ActivePresentation.Slides(1).TimeLine.MainSequence _
.AddEffect(Shape:=sh, effectId:=msoAnimEffectPathDiamond)
'Sets duration of effect
effDiamond.Timing.Duration = 5
End Sub