设置或返回 Shape 对象,该对象代表与动画触发器相关联的形状。可读写。
expression.TriggerShape
expression 必选。该表达式返回“应用于”列表中的对象之一。
以下示例向幻灯片添加一个形状,并对该形状添加动画,然后在单击该形状三秒钟后开始动画。
Sub AddShapeSetTiming()
Dim effDiamond As Effect
Dim shpRectangle As Shape
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:=shpRectangle, effectId:=msoAnimEffectPathDiamond)
With effDiamond.Timing
.Duration = 5
.TriggerShape = shpRectangle
.TriggerType = msoAnimTriggerOnShapeClick
.TriggerDelayTime = 3
End With
End Sub