Class AnimationBehaviors (PowerPoint VBA)

The class AnimationBehaviors represents a collection of AnimationBehavior objects. To use a AnimationBehaviors class variable it first needs to be instantiated, for example


Dim abs as AnimationBehaviors
Set abs = ActivePresentation.SlideMaster.TimeLine.MainSequence(1).Behaviors

Add

Returns an AnimationBehavior object that represents a new animation behavior.

The Type parameter value can be one of these MsoAnimType constants.

Add (Type, Index)


Dim abr As AnimationBehavior
Set abr = ActivePresentation.SlideMaster.TimeLine.MainSequence(1).Behaviors.Add(Type:=msoAnimTypeColor)

Arguments

The following argument is required

Type (MsoAnimType) - The type of the animation behavior.

Here you can find possible values for MsoAnimType

Optional arguments

The following argument is optional

Index (Long) - The position of the animation behavior in relation to other animation behaviors. The default value is -1, which means that if you omit the Index parameter, the new animation behavior is added at the end of the existing animation behaviors.

Count

Returns the number of objects in the specified collection.


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

Item

Returns a single AnimationBehavior object from the specified AnimationBehaviors collection.

Item (Index)

Index: The index number of the single AnimationBehavior object in the collection to be returned.


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