Share via


Sequence.AddEffect Method

Returns an ColorEffect object that represents a new animation effect added to a sequence of animation effects.

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

Syntax

'Declaration
Function AddEffect ( _
    Shape As Shape, _
    effectId As MsoAnimEffect, _
    Level As MsoAnimateByLevel, _
    trigger As MsoAnimTriggerType, _
    Index As Integer _
) As Effect
'Usage
Dim instance As Sequence
Dim Shape As Shape
Dim effectId As MsoAnimEffect
Dim Level As MsoAnimateByLevel
Dim trigger As MsoAnimTriggerType
Dim Index As Integer
Dim returnValue As Effect

returnValue = instance.AddEffect(Shape, _
    effectId, Level, trigger, Index)
Effect AddEffect(
    Shape Shape,
    MsoAnimEffect effectId,
    MsoAnimateByLevel Level,
    MsoAnimTriggerType trigger,
    int Index
)

Parameters

  • Index
    Type: System.Int32
    The position at which the effect will be placed in the collection of animation effects. The default value is -1 (added to the end).

Return Value

Type: Microsoft.Office.Interop.PowerPoint.Effect
Effect

Examples

The following example adds a bouncing animation to the first shape range on the first slide. This example assumes a shape range containing one or more shapes is selected on the first slide.

Sub AddBouncingAnimation()



    Dim sldActive As Slide

    Dim shpSelected As Shape



    Set sldActive = ActiveWindow.Selection.SlideRange(1)

    Set shpSelected = ActiveWindow.Selection.ShapeRange(1)



    ' Add a bouncing animation.

    sldActive.TimeLine.MainSequence.AddEffect_

        Shape:=shpSelected, effectId:=msoAnimEffectBounce



End Sub

See Also

Reference

Sequence Interface

Sequence Members

Microsoft.Office.Interop.PowerPoint Namespace