Table of contents
Collapse the table of content
Expand the table of content

AnimationPoint Object (PowerPoint)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Represents an individual animation point for an animation behavior. The AnimationPoint object is a member of the AnimationPoints collection. The AnimationPoints collection contains all the animation points for an animation behavior.


To add or reference an AnimationPoint object, use theAddor Itemmethod, respectively. Use the Timeproperty of an AnimationPoint object to set timing between animation points. Use the Value property to set other animation point properties, such as color. The following example adds three animation points to the first behavior in the active presentation's main animation sequence, and then it changes colors at each animation point.

Sub AniPoint()

    Dim sldNewSlide As Slide
    Dim shpHeart As Shape
    Dim effCustom As Effect
    Dim aniBehavior As AnimationBehavior
    Dim aptNewPoint As AnimationPoint

    Set sldNewSlide = ActivePresentation.Slides.Add _
        (Index:=1, Layout:=ppLayoutBlank)

    Set shpHeart = sldNewSlide.Shapes.AddShape _
        (Type:=msoShapeHeart, Left:=100, Top:=100, _
        Width:=200, Height:=200)

    Set effCustom = sldNewSlide.TimeLine.MainSequence _
        .AddEffect(shpHeart, msoAnimEffectCustom)

    Set aniBehavior = effCustom.Behaviors.Add(msoAnimTypeProperty)

    With aniBehavior.PropertyEffect
        .Property = msoAnimShapeFillColor
        Set aptNewPoint = .Points.Add
        aptNewPoint.Time = 0.2
        aptNewPoint.Value = RGB(0, 0, 0)
        Set aptNewPoint = .Points.Add
        aptNewPoint.Time = 0.5
        aptNewPoint.Value = RGB(0, 255, 0)
        Set aptNewPoint = .Points.Add
        aptNewPoint.Time = 1
        aptNewPoint.Value = RGB(0, 255, 255)
    End With

End Sub

See also


PowerPoint Object Model Reference

© 2018 Microsoft