RepeatCount Property

RepeatCount Property
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Sets or returns an Long that represents the number of times to repeat an animation. Read/write.

expression.RepeatCount

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This example creates a shape and adds an animation to it, then repeats the animation twice.

  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