用下面这个宏即可得到自动排练后,所有幻灯片播放的总时间:
Sub tt()
Dim eff As Effect, sli As Slide, tim1, tim2
For Each sli In ActivePresentation.Slides '历遍所有幻灯片
tim1 = sli.SlideShowTransition.AdvanceTime '自动切片时间
tim2 = 0
For Each eff In sli.TimeLine.MainSequence '历遍动画序列
With eff.Timing
tim2 = tim2 + (.Duration * .RepeatCount + .TriggerDelayTime) '动画持续时间*重复次数+动画延迟时间
End With
Next
If tim2 > tim1 Then '一页幻灯片动画时间总和与自动切片时间比较,大者为幻灯片实际持续时间
tim = tim + tim2
Else
tim = tim + tim1
End If
Next
MsgBox Format(tim, "0.00") & "秒"
End Sub