Share via


Timing.RepeatDuration Property

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

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
Property RepeatDuration As Single
    Get
    Set
'Usage
Dim instance As Timing
Dim value As Single

value = instance.RepeatDuration

instance.RepeatDuration = value
float RepeatDuration { get; set; }

Property Value

Type: System.Single
Single

Remarks

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

Examples

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

Reference

Timing Interface

Timing Members

Microsoft.Office.Interop.PowerPoint Namespace