Timing.RepeatDuration 属性 (PowerPoint)

设置或返回重复动画应持续的时间(以秒为单位)。 读/写。

语法

expressionRepeatDuration

表达 一个代表 Timing 对象的变量。

返回值

单精度

备注

动画将停止在其时间序列的末尾或 RepeatDuration 属性的值,较短者为准。

示例

本示例添加形状和动画,然后重复该动画十次。 但是,五秒钟后,动画将被截掉,即使动画标注为 20 秒的时间线 (如果未指定 Duration 属性,动画默认为两秒)。

Sub AddShapeSetTiming()

    Dim effDiamond As Effect
    Dim shpRectangle As Shape

    'Adds new shape and sets animation effect
    Set shpRectangle = ActivePresentation.Slides(1).Shapes _
        .AddShape(Type:=msoShapeRectangle, Left:=100, _
        Top:=100, Width:=50, Height:=50)

    Set effDiamond = ActivePresentation.Slides(1).TimeLine.MainSequence _
        .AddEffect(Shape:=shpRectangle, effectId:=msoAnimEffectPathDiamond)

    'Sets repeat duration and number of times to repeat animation
    With effDiamond.Timing
        .RepeatDuration = 5
        .RepeatCount = 10
    End With

End Sub

另请参阅

计时对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。