Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

AddEffect Method

AddEffect Method
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.  

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

expression.AddEffect(Shape, effectId, Level, trigger, Index)

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

Shape  Required Shape object. The shape to which the animation effect is added.

MsoAnimEffect can be one of these MsoAnimEffect constants.
msoAnimEffectAppear
msoAnimEffectArcUp
msoAnimEffectAscend
msoAnimEffectBlast
msoAnimEffectBlinds
msoAnimEffectBoldFlash
msoAnimEffectBoldReveal
msoAnimEffectBoomerang
msoAnimEffectBounce
msoAnimEffectBox
msoAnimEffectBrushOnColor
msoAnimEffectBrushOnUnderline
msoAnimEffectCenterRevolve
msoAnimEffectChangeFillColor
msoAnimEffectChangeFont
msoAnimEffectChangeFontColor
msoAnimEffectChangeFontSize
msoAnimEffectChangeFontStyle
msoAnimEffectChangeLineColor
msoAnimEffectCheckerboard
msoAnimEffectCircle
msoAnimEffectColorBlend
msoAnimEffectColorReveal
msoAnimEffectColorWave
msoAnimEffectComplementaryColor
msoAnimEffectComplementaryColor2
msoAnimEffectContrastingColor
msoAnimEffectCrawl
msoAnimEffectCredits
msoAnimEffectCustom
msoAnimEffectDarken
msoAnimEffectDesaturate
msoAnimEffectDescend
msoAnimEffectDiamond
msoAnimEffectDissolve
msoAnimEffectEaseIn
msoAnimEffectExpand
msoAnimEffectFade
msoAnimEffectFadedAscend
msoAnimEffectFadedSwivel
msoAnimEffectFadedZoom
msoAnimEffectFlashBulb
msoAnimEffectFlashOnce
msoAnimEffectFlicker
msoAnimEffectFlip
msoAnimEffectFloat
msoAnimEffectFly
msoAnimEffectFold
msoAnimEffectGlide
msoAnimEffectGrowAndTurn
msoAnimEffectGrowShrink
msoAnimEffectGrowWithColor
msoAnimEffectLighten
msoAnimEffectLightSpeed
msoAnimEffectMediaPause
msoAnimEffectMediaPlay
msoAnimEffectMediaStop
msoAnimEffectPath4PointStar
msoAnimEffectPath5PointStar
msoAnimEffectPath6PointStar
msoAnimEffectPath8PointStar
msoAnimEffectPathArcDown
msoAnimEffectPathArcLeft
msoAnimEffectPathArcRight
msoAnimEffectPathArcUp
msoAnimEffectPathBean
msoAnimEffectPathBounceLeft
msoAnimEffectPathBounceRight
msoAnimEffectPathBuzzsaw
msoAnimEffectPathCircle
msoAnimEffectPathCrescentMoon
msoAnimEffectPathCurvedSquare
msoAnimEffectPathCurvedX
msoAnimEffectPathCurvyLeft
msoAnimEffectPathCurvyRight
msoAnimEffectPathCurvyStar
msoAnimEffectPathDecayingWave
msoAnimEffectPathDiagonalDownRight
msoAnimEffectPathDiagonalUpRight
msoAnimEffectPathDiamond
msoAnimEffectPathDown
msoAnimEffectPathEqualTriangle
msoAnimEffectPathFigure8Four
msoAnimEffectPathFootball
msoAnimEffectPathFunnel
msoAnimEffectPathHeart
msoAnimEffectPathHeartbeat
msoAnimEffectPathHexagon
msoAnimEffectPathHorizontalFigure8
msoAnimEffectPathInvertedSquare
msoAnimEffectPathInvertedTriangle
msoAnimEffectPathLeft
msoAnimEffectPathLoopdeLoop
msoAnimEffectPathNeutron
msoAnimEffectPathOctagon
msoAnimEffectPathParallelogram
msoAnimEffectPathPeanut
msoAnimEffectPathPentagon
msoAnimEffectPathPlus
msoAnimEffectPathPointyStar
msoAnimEffectPathRightTriangle
msoAnimEffectPathSCurve1
msoAnimEffectPathSCurve2
msoAnimEffectPathSineWave
msoAnimEffectPathSpiralLeft
msoAnimEffectPathSpiralRight
msoAnimEffectPathSpring
msoAnimEffectPathSquare
msoAnimEffectPathStairsDown
msoAnimEffectPathSwoosh
msoAnimEffectPathTeardrop
msoAnimEffectPathTrapezoid
msoAnimEffectPathTurnDown
msoAnimEffectPathTurnRight
msoAnimEffectPathTurnUp
msoAnimEffectPathTurnUpRight
msoAnimEffectPathVerticalFigure8
msoAnimEffectPathWave
msoAnimEffectPathZigzag
msoAnimEffectPeek
msoAnimEffectPinwheel
msoAnimEffectPlus
msoAnimEffectRandomBars
msoAnimEffectRandomEffects
msoAnimEffectRiseUp
msoAnimEffectShimmer
msoAnimEffectSling
msoAnimEffectSpin
msoAnimEffectSpinner
msoAnimEffectSpiral
msoAnimEffectSplit
msoAnimEffectStretch
msoAnimEffectStretchy
msoAnimEffectStrips
msoAnimEffectStyleEmphasis
msoAnimEffectSwish
msoAnimEffectSwivel
msoAnimEffectTeeter
msoAnimEffectThinLine
msoAnimEffectTransparency
msoAnimEffectUnfold
msoAnimEffectVerticalGrow
msoAnimEffectWave
msoAnimEffectWedge
msoAnimEffectWheel
msoAnimEffectWhip
msoAnimEffectWipe
msoAnimEffectZip
msoAnimEffectZoom

MsoAnimateByLevel can be one of these MsoAnimateByLevel constants.
msoAnimateChartAllAtOnce
msoAnimateChartByCategory
msoAnimateChartByCategoryElements
msoAnimateChartBySeries
msoAnimateChartBySeriesElements
msoAnimateDiagramAllAtOnce
msoAnimateDiagramBreadthByLevel
msoAnimateDiagramBreadthByNode
msoAnimateDiagramClockwise
msoAnimateDiagramClockwiseIn
msoAnimateDiagramClockwiseOut
msoAnimateDiagramCounterClockwise
msoAnimateDiagramCounterClockwiseIn
msoAnimateDiagramCounterClockwiseOut
msoAnimateDiagramDepthByBranch
msoAnimateDiagramDepthByNode
msoAnimateDiagramDown
msoAnimateDiagramInByRing
msoAnimateDiagramOutByRing
msoAnimateDiagramUp
msoAnimateLevelMixed
msoAnimateTextByAllLevels
msoAnimateTextByFifthLevel
msoAnimateTextByFirstLevel
msoAnimateTextByFourthLevel
msoAnimateTextBySecondLevel
msoAnimateTextByThirdLevel
msoAnimationLevelNone

MsoAnimTriggerType can be one of these MsoAnimTriggerType constants.
msoAnimTriggerAfterPrevious
msoAnimTriggerMixed
msoAnimTriggerNone
msoAnimTriggerOnPageClick  
msoAnimTriggerOnShapeClick
msoAnimTriggerWithPrevious
Index  Optional Long. The position at which the effect will be placed in the collection of animation effects. The default value is -1 (added to the end).

Example

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
Show: