Timing.RepeatDuration property (PowerPoint)

Sets or returns how long repeated animations should last, in seconds. Read/write.

Syntax

expression. RepeatDuration

expression A variable that represents a Timing object.

Return value

Single

Remarks

An animation will stop at the end of its time sequence or the value of the RepeatDuration property, whichever is shorter.

Example

This examples adds a shape and an animation to it, then repeats the animation ten times. However, after five seconds, the animation will be cut off, even though the animation is dimensioned for a 20-second timeline (if the Duration property is not specified, an animation defaults to two seconds).

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

See also

Timing Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.