27

My company recently created a new PowerPoint template. On its own without any slides, it is 9MB in size. This is completely unusable for sending to mobile devices and annoys customers. The main culprit is high resolution images on the master slides. Most of the time I don't use the 8 slides with the high resolution images. I have tried compressing the images, but that only get's the template down to 5MB empty, still too big.

Is there anyway to save the presentation an automatically discard the unused giant master slides. Obviously I can go in and delete the master slides, but was wondering if there is anything that allows you to automatically do this.

3
  • This can be done with VBA or other types of automation; there's nothing built into PPT that lets the user do this easily. Commented Nov 14, 2014 at 4:37
  • have you tried saving it in PDF format, would also be better with mobile devices.
    – Firee
    Commented Dec 8, 2014 at 11:57
  • Often, very large (pixel dimension) images are embedded in PowerPoint and the display size shrunken to fit. Besides causing a huge file, it can reduce image sharpness because of the interpolation needed. You can seriously reduce the file size and improve appearance by looking at the maximum actual resolution you will need, based on what the slides will be viewed on. Resize the images to that resolution (externally, using an image editor), sharpen them, and then embed them in PowerPoint. If you don't need those slides at all, deleting them will have a bigger effect, of course.
    – fixer1234
    Commented Jan 8, 2016 at 23:54

6 Answers 6

19

View as "slide masters". When you mouse over each slide master, you can see if that slide master is used. You can individually delete each slide master. Looks especially for those with pictures and remove the ones not used.

If you highlight the first slide, then keep hitting Delete repeatedly, only the slide templates that are not in use will be deleted. This is an easy way to manually roll through the templates quickly without worrying about removing one that is in use.

5
  • 1
    I was looking for a bit more of an automated solution. Our template has around 100 master slides, which would take a very long time to delete all individually.
    – Scott
    Commented Dec 15, 2014 at 15:39
  • Since it shows you right on the slide browser which masters are used and which aren't, it sure seems like that should be possible. Nonetheless, I'm delighted to have found a solution that lets me reduce the file size even if I do have to do it manually.
    – octern
    Commented May 8, 2015 at 19:05
  • This is great and finally resolved why a blank, lone slide was taking up ~1MB in my presentation. @Scott if you're using a select few and know where they are, click, scroll, shift + click, delete is actually pretty fast. Or save out a new template with the ones you'll never use and you'd only have to do it once.
    – Hendy
    Commented Jul 19, 2017 at 21:00
  • 1
    Be careful: in Powerpoint for Office 365 MSO, it's allowed to delete a Master and all its Layouts are deleted without checking if they are used. Consequently, the procedure is better delete repeatedly the Layouts (only the ones used can be deleted) then delete the Masters which have no Layout left. NB: this bug can be verified by having several Masters because with only one Master it's forbidden to delete it because there must always be at least one Master. Commented Jul 30, 2020 at 12:10
  • 1
    Here is an add-in that removes unused layouts and master slides. aneejian.com/powerpoint-downsizer-add-in
    – Ian
    Commented Feb 25, 2021 at 1:31
25

You can do this by creating a macro:

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
2
  • any design can be removed completely with all its layouts using design's .Delete method
    – Winand
    Commented Nov 12, 2019 at 22:28
  • Where is the conditional logic, to remove only the not used layouts? Commented Sep 9, 2021 at 5:40
5

The upvoted answer above still works and did work for me. The problem was that, when I copie the code I did not know what to do with it.

After a little research, I found that this is how to use the code above:

  1. Open your PPT doc
  2. Go to View, Click Macros
  3. Choose where you want to be able to run this macro in the dropdown
  4. Give it a name and create it.

Then a window pops up where you can paste the code.

Save it, go back to View-->Macros and Select the macro from the dropdown.

Click "Run" and DONE!

4

Updated @Moogle's VBA with @SandraRossi's procedure, plus print some statistics in the Immediate window of the VBA Editor (ALT + F11 or Developer > Visual Basic).

Sub SlideMasterCleanup()

Dim i As Integer
Dim j As Integer
Dim iLayouts As Integer
Dim oPres As Presentation
Set oPres = ActivePresentation
On Error Resume Next

iLayouts = 0
Debug.Print "Before: # of designs:", oPres.Designs.Count
With oPres
    For i = 1 To .Designs.Count
        iLayouts = iLayouts + .Designs(i).SlideMaster.CustomLayouts.Count
        For j = .Designs(i).SlideMaster.CustomLayouts.Count To 1 Step -1
            .Designs(i).SlideMaster.CustomLayouts(j).Delete
        Next
    Next i
End With
Debug.Print "Before: # of layouts", iLayouts

' Delete masters having no layouts
With oPres
    For i = 1 To .Designs.Count
        If .Designs(i).SlideMaster.CustomLayouts.Count = 0 Then
            .Designs(i).Delete
        End If
    Next i
End With

iLayouts = 0
Debug.Print "After: # of designs:", oPres.Designs.Count
With oPres
    For i = 1 To .Designs.Count
        iLayouts = iLayouts + .Designs(i).SlideMaster.CustomLayouts.Count
    Next i
End With
Debug.Print "After: # of layouts", iLayouts


End Sub
1

Below is basically the same answer as hazelmoon, but with screenshots and additional comments, especially a warning concerning the Master deletion which does not check if its Layouts are still used in the presentation.

In the menu View, click the button "Slide Master":

Powerpoint Slide Masters and Layouts

When you mouse over each slide Layout, you can see if that slide Layout is used:

enter image description here

You can individually delete each slide Layout. Look especially for those with pictures and remove the ones not used.

If you highlight the first slide, then keep hitting Delete repeatedly, only the slide templates that are not in use will be deleted. This is an easy way to manually roll through the templates quickly without worrying about removing one that is in use. If you select the first Layout, then keep hitting Delete repeatedly, only the slide Layouts that are not in use will be deleted.

This is an easy way to manually roll through the Layouts quickly without worrying about removing one that is in use.

Be careful, in Powerpoint for Office 365 MSO (and maybe more versions), deleting a Master will delete also its Layouts even if some of them are used (while deleting directly a Layout is not allowed if it's used). Consequently, delete first the unused Layouts repeatedly as you can be sure to not delete the used ones, then delete those Masters which don't have any Layout left.

Powerpoint Slide Masters and Layouts

1

The scripts above work but they do not eliminate all the unused master layouts, because either do not try (the first version) or because of the re-indexing that happens when you delete a master layout if it is not the last one -> Master Layout 4 is deleted and now former Master Layout 5 is Master Layout 4, which will not be deleted no matter what because the index will be on 5.

The scripts take this effect into account for the children layouts but not the master ones. The result is that when you execute the VBA, there are still master layouts left with unused layouts. To solve it you just need to count backwards also with the designs. Using a simplified version of @GrandWazoo code (w/o counters):

Sub SlideMasterCleanup()
    Dim i As Integer
    Dim j As Integer
    Dim oPres As Presentation
    Set oPres = ActivePresentation
    On Error Resume Next
    With oPres
'Delete unused layouts
        For i = .Designs.Count To 1 Step -1
            For j = .Designs(i).SlideMaster.CustomLayouts.Count To 1 Step -1
                .Designs(i).SlideMaster.CustomLayouts(j).Delete
            Next
        Next i
' Delete masters having no layouts
    For i = .Designs.Count To 1 Step -1
        If .Designs(i).SlideMaster.CustomLayouts.Count = 0 Then
            .Designs(i).Delete
        End If
    Next i
    End With
End Sub

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .