Class AnimationBehavior (PowerPoint VBA)

The class AnimationBehavior represents the behavior of an animation effect, the main animation sequence, or an interactive animation sequence. The AnimationBehavior object is a member of the AnimationBehaviors collection.

The main procedures of class AnimationBehavior are Delete and AnimationBehaviors.Add


To use a AnimationBehavior class variable it first needs to be instantiated, for example

Dim abr as AnimationBehavior
Set abr = ActivePresentation.SlideMaster.TimeLine.MainSequence(1).Behaviors(Index:=1)

The following procedures can be used to set variables of type AnimationBehavior: AnimationBehaviors.Item, AnimationBehaviors.Add and Effect.Behaviors


The following procedures in this class have been grouped together and are described on a separate theme page

Add with its procedures Additive and AnimationBehaviors.Add


These are the main methods of the AnimationBehavior class

Delete - Deletes the specified AnimationBehavior object.



Accumulate determines whether animation behaviors accumulate.

ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).Accumulate = msoAnimAccumulateAlways

ColorEffect returns a ColorEffect object that represents the color properties for a specified animation behavior.

Dim cetColorEffect As ColorEffect
Set cetColorEffect = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).ColorEffect

CommandEffect returns a CommandEffect object for the specified animation behavior.

Dim cetCommandEffect As CommandEffect
Set cetCommandEffect = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).CommandEffect

FilterEffect returns a FilterEffect object that represents a filter effect for an animation behavior.

Dim fetFilterEffect As FilterEffect
Set fetFilterEffect = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).FilterEffect

MotionEffect returns a MotionEffect object that represents the properties of a motion animation.

Dim metMotionEffect As MotionEffect
Set metMotionEffect = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).MotionEffect

Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).Parent

PropertyEffect returns a PropertyEffect object for a given animation behavior.

Dim petPropertyEffect As PropertyEffect
Set petPropertyEffect = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).PropertyEffect

RotationEffect returns a RotationEffect object for an animation behavior.

Dim retRotationEffect As RotationEffect
Set retRotationEffect = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).RotationEffect

ScaleEffect returns a ScaleEffect object for a given animation behavior.

Dim setScaleEffect As ScaleEffect
Set setScaleEffect = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).ScaleEffect

SetEffect returns a SetEffect object for the animation behavior.

Dim setSetEffect As SetEffect
Set setSetEffect = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).SetEffect

Timing returns a Timing object that represents the timing properties for an animation sequence.

Dim tmnTiming As Timing
Set tmnTiming = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors(1).Timing

Type represents the type of animation.

ActivePresentation.SlideMaster.TimeLine.MainSequence(1).Behaviors(1).Type = msoAnimTypeColor

AnimationBehaviors.Count returns the number of objects in the specified collection.

Dim lngCount As Long
lngCount = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors.Count

AnimationBehaviors.Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.Selection.SlideRange(1).TimeLine.MainSequence(1).Behaviors.Parent