MoveBefore Method

Microsoft PowerPoint Visual Basic

expression.MoveBefore(Effect)

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

EffectRequired Effect object. The effect before which the effect in expression    will be moved.

Example

The following example moves one effect in front of another one.

Sub MoveEffect()
    Dim effOne As Effect
    Dim effTwo As Effect
    Dim shpFirst As Shape

    Set shpFirst = ActivePresentation.Slides(1).Shapes(1)
    Set effOne = ActivePresentation.Slides(1).TimeLine.MainSequence.AddEffect _
        (Shape:=shpFirst, effectId:=msoAnimEffectBlinds)
    Set effTwo = ActivePresentation.Slides(1).TimeLine.MainSequence.AddEffect _
        (Shape:=shpFirst, effectId:=msoAnimEffectBlast)

    effTwo.MoveBefore Effect:=effOne
End Sub