仅从激活的幻灯片中删除动画
Animation removal from activated slide only
我正在尝试借助 powerpoint 中的 vbscript 删除动画。
但它应该只从选定的幻灯片中删除,而不是从所有幻灯片中删除
我已经尝试了一些代码,但它正在从示例代码下方共享的所有幻灯片中删除,任何人都可以帮我解决这个问题
Sub RemoveAllAnimations()
'PURPOSE: Remove All PowerPoint Animations From Slides
'SOURCE: www.TheSpreadsheetGuru.com/the-code-vault
Dim sld As Slide
Dim x As Long
Dim Counter As Long
'Loop Through Each Slide in ActivePresentation
For Each sld In ActivePresentation.Slides
'Loop through each animation on slide
For x = sld.TimeLine.MainSequence.Count To 1 Step -1
'Remove Each Animation
sld.TimeLine.MainSequence.Item(x).Delete
'Maintain Deletion Stat
Counter = Counter + 1
Next x
Next sld
'Completion Notification
MsgBox Counter & " Animation(s) were removed from you PowerPoint presentation!"
End Sub
它正在从所有幻灯片中删除动画
仅针对所选幻灯片:
Sub RemoveAllAnimations()
Dim sld As Slide
Dim x As Long
Dim Counter As Long
Set sld = ActiveWindow.View.Slide
For x = sld.TimeLine.MainSequence.Count To 1 Step -1
sld.TimeLine.MainSequence.Item(x).Delete
Counter = Counter + 1
Next x
Set sld = Nothing
MsgBox Counter & " Animation(s) were removed from your PowerPoint presentation!"
End Sub
我正在尝试借助 powerpoint 中的 vbscript 删除动画。 但它应该只从选定的幻灯片中删除,而不是从所有幻灯片中删除
我已经尝试了一些代码,但它正在从示例代码下方共享的所有幻灯片中删除,任何人都可以帮我解决这个问题
Sub RemoveAllAnimations()
'PURPOSE: Remove All PowerPoint Animations From Slides
'SOURCE: www.TheSpreadsheetGuru.com/the-code-vault
Dim sld As Slide
Dim x As Long
Dim Counter As Long
'Loop Through Each Slide in ActivePresentation
For Each sld In ActivePresentation.Slides
'Loop through each animation on slide
For x = sld.TimeLine.MainSequence.Count To 1 Step -1
'Remove Each Animation
sld.TimeLine.MainSequence.Item(x).Delete
'Maintain Deletion Stat
Counter = Counter + 1
Next x
Next sld
'Completion Notification
MsgBox Counter & " Animation(s) were removed from you PowerPoint presentation!"
End Sub
它正在从所有幻灯片中删除动画
仅针对所选幻灯片:
Sub RemoveAllAnimations()
Dim sld As Slide
Dim x As Long
Dim Counter As Long
Set sld = ActiveWindow.View.Slide
For x = sld.TimeLine.MainSequence.Count To 1 Step -1
sld.TimeLine.MainSequence.Item(x).Delete
Counter = Counter + 1
Next x
Set sld = Nothing
MsgBox Counter & " Animation(s) were removed from your PowerPoint presentation!"
End Sub