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.
[PowerPoint Slide Master Clean Up] #PowerPoint
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment