PowerPoint VBA教程:AddEffect方法

返回一个Effect对象,该对象代表一个已添加到动画效果序列中的新动画效果。

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

expression  必选。该表达式返回“应用于”列表中的对象之一。

Shape  必选。Shape对象。添加动画效果的形状。

effectId  必选。MsoAnimEffect 类型。要应用的动画效果。

MsoAnimEffect 可以是下列 MsoAnimEffect 类型常数之一。
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  可选。MsoAnimateByLevel 类型。对图表、图示或文本,将应用相应的动画效果级别。默认值为 msoAnimationLevelNone。

MsoAnimateByLevel 可以是下列 MsoAnimateByLevel 类型常数之一。
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  可选。MsoAnimTriggerType 类型。触发动画效果的动作。默认值为 msoAnimTriggerOnPageClick。

MsoAnimTriggerType 可以是下列 MsoAnimTriggerType 常数之一。
msoAnimTriggerAfterPrevious
msoAnimTriggerMixed
msoAnimTriggerNone
msoAnimTriggerOnPageClick  
msoAnimTriggerOnShapeClick
msoAnimTriggerWithPrevious
Index  可选。Long 类型。效果在动画效果集合中放置的位置。默认值为 -1(添加到末尾)。

VBA示例

以下示例将一个弹跳的动画添加到第一张幻灯片的第一个形状范围内。本示例假定形状范围包含在第一张幻灯片中选定的一个或多个形状。


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

上页:PowerPoint VBA教程:AddDiagram方法 下页:PowerPoint VBA教程:AddLabel方法

PowerPoint VBA教程:AddEffect方法

PowerPoint VBA教程:AddLabel方法 PowerPoint VBA教程:AddLine方法
PowerPoint VBA教程:AddMediaObject方法 PowerPoint VBA教程:AddNode方法
PowerPoint VBA教程:AddNodes方法 PowerPoint VBA教程:AddOLEObject方法
PowerPoint VBA教程:AddPeriods方法 PowerPoint VBA教程:AddPicture方法
PowerPoint VBA教程:AddPlaceholder方法 PowerPoint VBA教程:AddPolyline方法
PowerPoint VBA教程:AddShape方法 PowerPoint VBA教程:AddTable方法
PowerPoint VBA教程:AddTextbox方法 PowerPoint VBA教程:AddTextEffect方法
PowerPoint VBA教程:AddTitle方法 PowerPoint VBA教程:AddTitleMaster方法
PowerPoint VBA教程:AddToFavorites方法 PowerPoint VBA教程:Align方法
PowerPoint VBA教程:Apply方法 PowerPoint VBA教程:ApplyTemplate方法
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号