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.
effectId Required MsoAnimEffect. The animation effect to be applied.
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 |
Level Optional MsoAnimateByLevel. For charts, diagrams, or text, the level to which the animation effect will be applied. The default value is msoAnimationLevelNone.
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 |
trigger Optional MsoAnimTriggerType. The action that triggers the animation effect. The default value is msoAnimTriggerOnPageClick.
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