MainSequence Property

Microsoft PowerPoint Visual Basic

MainSequence Property

       

Returns a Sequence object that represents the collection of Effect objects in the main animation sequence of a slide.

expression.MainSequence

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

Remarks

The default value of the MainSequence property is an empty Sequence collection. Any attempt to return a value from this property without adding one or more Effect objects to the main animation sequence will result in a run-time error.

Example

The following example adds a boomerang animation to a new shape on a new slide added to the active presentation.

Sub NewSequence()
    Dim sldNew As Slide
    Dim shpnew As Shape

    Set sldNew = ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutBlank)
    Set shpnew = sldNew.Shapes.AddShape(Type:=msoShape5pointStar, _
        Left:=25, Top:=25, Width:=100, Height:=100)

    With sldNew.TimeLine.MainSequence.AddEffect(Shape:=shpnew, _
            EffectId:=msoAnimEffectBoomerang)
        .Timing.Speed = 0.5
        .Timing.Accelerate = 0.2
    End With
End Sub