昨天有個PPT愛好者提出了一個要求,問是否有方法一次性刪除PPT中所有的動畫效果,想想也是合理的,PPT中是沒有這個功能的,只能在每個PPT頁面中一張張刪除,如果有幾百張,確實也是個煩人的工作。想來也只有通過PPT軟件中的VBA來解決了,幾乎搜遍了所有的網站,最後終於找到了答案,將代碼給各位分享。
代碼以下:
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
.