Share via


Timing.Duration Property

Returns or sets the length of an animation in seconds. Read/write.

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

Syntax

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

value = instance.Duration

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

Property Value

Type: System.Single
Single

Examples

The following example adds a shape and an animation to that shape, then sets its animation duration.

Sub AddShapeSetTiming()



    Dim effDiamond As Effect

    Dim shpRectangle As Shape



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



    'Sets duration of effect

    effDiamond.Timing.Duration= 5



End Sub

See Also

Reference

Timing Interface

Timing Members

Microsoft.Office.Interop.PowerPoint Namespace