PDA

View Full Version : Remove all Animations and Transitions with Macro



OfficeWorker
12-15-2020, 03:19 AM
Hi,

New user here with little VBA macro code experience. I'm struggling with modifying the excellent code from TheSpreadshhetGuru that removes all my animations.

I would like the macro to also remove all transitions in my Powerpoint and set manual advance. I google some code, but struggling to tie it into the code from TSG? Any help would be appreciated:-)

.SlideShowTransition.EntryEffect = ppEffectNone
.SlideShowTransition.AdvanceOnTime = msoFalse




Sub RemoveAllAnimations()
'PURPOSE: Remove All PowerPoint Animations From Slides
'SOURCE: www.TheSpreadsheetGuru.com/the-code-vault

Dim sld As Slide
Dim x AsLong
Dim Counter AsLong

'Loop Through Each Slide in ActivePresentation
ForEach 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!"

EndSub

John Wilson
12-15-2020, 06:12 AM
Try


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
sld.SlideShowTransition.AdvanceOnTime = False
sld.SlideShowTransition.AdvanceOnClick = True
sld.SlideShowTransition.EntryEffect = ppEffectNone
Next sld


'Completion Notification
MsgBox Counter & " Animation(s) were removed from you PowerPoint presentation!"


End Sub

OfficeWorker
12-15-2020, 09:21 AM
Thanks a lot John for your swift reply and resolution:-) This one seem to do the trick:bow:

paulwilson
08-24-2021, 10:10 PM
I have a similar problem - I have a larger number of powerpoint files, in which each slide has dozens of animations with sound effects. I want to keep the animations but remove (or mute) the sound effects. Is there a way to do this?

John Wilson
08-25-2021, 04:21 AM
Try this (use a copy of the presentation just in case)


Sub kill_soundeffect()
Dim oeff As Effect
Dim osld As Slide
For Each osld In ActivePresentation.Slides
For Each oeff In osld.TimeLine.MainSequence
oeff.EffectInformation.SoundEffect.Type = ppSoundNone
Next oeff
Next osld
End Sub