Skip to content

Instantly share code, notes, and snippets.

@martinctc
Last active June 29, 2020 08:26
Show Gist options
  • Save martinctc/c98545df02aa807424134e6e7f0cd7b1 to your computer and use it in GitHub Desktop.
Save martinctc/c98545df02aa807424134e6e7f0cd7b1 to your computer and use it in GitHub Desktop.

Revisions

  1. martinctc revised this gist Mar 3, 2019. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion SlideMasterCleanup.vbs
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,9 @@
    Sub SlideMasterCleanup()

    ' This macro cleans up all the unused slide layouts in your Slide Master.
    ' Primarily used for reducing file size, especially if slide layouts make use of large HD images.
    ' Should ideally be used once the contents are near-complete, to ensure that you do not need those additional slide layouts.

    Dim i As Integer
    Dim j As Integer
    Dim oPres As Presentation
    @@ -12,5 +16,4 @@ With oPres
    Next
    Next i
    End With

    End Sub
  2. martinctc created this gist Sep 21, 2018.
    16 changes: 16 additions & 0 deletions SlideMasterCleanup.vbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    Sub SlideMasterCleanup()

    Dim i As Integer
    Dim j As Integer
    Dim oPres As Presentation
    Set oPres = ActivePresentation
    On Error Resume Next
    With oPres
    For i = 1 To .Designs.Count
    For j = .Designs(i).SlideMaster.CustomLayouts.Count To 1 Step -1
    .Designs(i).SlideMaster.CustomLayouts(j).Delete
    Next
    Next i
    End With

    End Sub