设置或返回 Long 类型值,该值代表重复动画所需的次数。可读写。
expression.RepeatCount
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 ' Length of effect.
        .RepeatCount = 2 ' How many times to repeat.
    End With
End Sub