AnimationPoints![]() |
代表动画动作的单个动画点。AnimationPoint 对象是 AnimationPoints 集合的成员。AnimationPoints 集合包含动画动作的所有动画点。
若要添加或引用 AnimationPoint 对象,请分别使用 Add 或 Item 方法。使用 AnimationPoint 对象的 Time 属性设置动画点之间的计时。使用 Value 属性设置其他动画点属性,如颜色。以下示例在当前演示文稿的主动画序列的第一个动作中添加三个动画点,然后更改每个动画点的颜色。
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