RepeatDuration 属性

       

设置或返回 Single 类型值,该值代表重复动画应持续的时间(以秒为单位)。可读写。

expression.RepeatDuration

expression  必选。该表达式返回“应用于”列表中的对象之一。

说明

在动画时间序列结束或 RepeatDuration 属性值到达末尾(无论二者谁先发生)时,动画将停止。

示例

本示例添加一个形状并对该形状添加一个动画,然后重复该动画十次。然而,尽管该动画的持续时间应为 20 秒,但五秒中后该动画将停止(如果未指定 Duration 属性,动画默认的持续时间为两秒钟)。

Sub AddShapeSetTiming()
    Dim effDiamond As Effect
    Dim shpRectangle As Shape

    'Adds new 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:=shpRectangle, effectId:=msoAnimEffectPathDiamond)

    'Sets repeat duration and number of times to repeat animation
    With effDiamond.Timing
        .RepeatDuration = 5
        .RepeatCount = 10
    End With

End Sub