|
昨天有个客户提出了一个要求,问是否有方法一次性删除slide中所有的动画,想想也是合理的,powerpoint中是没有这个功能的,只能在每个页面中一张张删除,如果有几百张,确实也是个烦人的工作。想来也只有通过VBA来解决了,几乎搜遍了所有的网站,最后终于找到了答案,将代码给各位分享。
code:
===================================
Sub removeALL()
Dim I As Integer: Dim J As Integer
Dim oActivePres As Object
Set oActivePres = ActivePresentation
With oActivePres
For I = 1 To .Slides.Count
If Val(Application.Version) < 10 Then
For J = 1 To .Slides(I).Shapes.Count
.Slides(I).Shapes(J).AnimationSettings.Animate = msoFalse
Next J
Else
For J = .Slides(I).TimeLine.MainSequence.Count To 1 Step -1
.Slides(I).TimeLine.MainSequence(J).Delete
Next J
End If
Next I
End With
Set oActivePres = Nothing
End Sub
==============================================
UPDATE:ExcelPro的图表博客同学说:在放映设置中设为“播放时不带动画”就可以了达到同样效果,多好的方法!我绕了一大圈,哈哈。 |
|