OfficeTips Home || VBA Section || General Section || Download Section || Privacy Policy

Clear all the animations from a presentation
 

If you wish to temporarily disable the animations please make use of the slide show settings.
Select Slide Show | Set up show... and select the show options to 'Show without animations'.

However if you wish to remove all assigned animations completely, use the following code to remove all the animations from the active presentation.

Note: If you clear animation from the wrong presentation DO NOT save that file. Simply close the file and reopen it and the animation settings set will not be lost.


' --------------------------------------------------------------------------------
' Copyright ©1999-2018, Shyam Pillai, All Rights Reserved.
' --------------------------------------------------------------------------------
' You are free to use this code within your own applications, add-ins,
' documents etc but you are expressly forbidden from selling or
' otherwise distributing this source code without prior consent.
' This includes both posting free demo projects made from this
' code as well as reproducing the code in text or html format.
' --------------------------------------------------------------------------------

Sub StripAllBuilds()
    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
             
  ' Older versions of PowerPoint 97/2000
                ' In each slide set the animation property
                ' of the Shape object to FALSE

                For J = 1 To .Slides(I).Shapes.Count
                    .Slides(I).Shapes(J).AnimationSettings.Animate = msoFalse
                Next J
            Else
                
' New versions support the Timeline object
                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


 

Exporting All Slide Titles To  A Text File

 


This routine exports all Slide titles into a text file. It makes use of the HasTitle property to ascertain the existence of a title on the slide and then proceeds to locate the Title PlaceHolder. It prompts the user for a filename and then writes the title texts into it. If you find this routine useful you would be able to extend its functionality to copying the texts to the clipboard.


' --------------------------------------------------------------------------------
' Copyright ©1999-2018, Shyam Pillai, All Rights Reserved.
' --------------------------------------------------------------------------------
' You are free to use this code within your own applications, add-ins,
' documents etc but you are expressly forbidden from selling or
' otherwise distributing this source code without prior consent.
' This includes both posting free demo projects made from this
' code as well as reproducing the code in text or html format.
' --------------------------------------------------------------------------------

 

Sub ExportSldTitles()
' Stores the filename provide by the user
Dim strFileName As String
' Both I & J are used as counters
Dim I As Integer 
Dim J As Integer
' Working on the active presentation.
   With ActivePresentation
     
'Display the input box with the default 'Titles.Txt'
      strFileName = InputBox("Enter a filename to export slide titles", _
                                         "Provide filename...", "Titles.txt")
'Check if the user has pressed Cancel (Inputbox returns a zero length string)
If strFileName = "" Then
    Exit Sub
End If
' Do some good housekeeping and check for the existence of the file.
' Ask the user for further directions in case it does. : )
If Dir(.Path & "\" & strFileName) <> "" Then
    If MsgBox(strFileName & " already exists. Overwrite it?", _
                vbQuestion + vbYesNo, "Warning") = vbNo Then
        Exit Sub
    End If
End If
' Open the file for exporting the slide titles. File is created in the same folder as the open presentation.
' If the Presentation is a new one (No path) then it will get created in the Root Folder
Open .Path & "\" & strFileName For Output As #1
For I = 1 To .Slides.Count
   ' Returns TRUE if there is a TitlePlaceholder
   If .Slides(I).Shapes.HasTitle Then
   ' Now loop thru the PlaceHolders and pick the text from the TitlePlaceHolder
       For J = 1 To .Slides(I).Shapes.Placeholders.Count
           With .Slides(I).Shapes.Placeholders.Item(J)
           If .PlaceholderFormat.Type = ppPlaceholderTitle Then
               ' Just inserted for debugging purposes...
              Debug.Print .TextFrame.TextRange
              ' Write the title text to the output file
              Print #1, .TextFrame.TextRange
           End If
           End With
       Next J
   End If
   Next I
   'Close the open file
   Close #1
   End With
End Sub


 

 

Copyright 1999-2018 (c) Shyam Pillai. All rights reserved.