title: How to clear Slide Master of all information in PowerPoint using VBA?
body: <p>I would like to open every PowerPoint (*.pptx) in current folder and clear the Slide Master of all images and text boxes and then save.</p>
  
  <p>(It says my post is mostly code so I need to add more detail, so here is a quote by George Washington, "Associate with men of good quality if you esteem your own reputation; for it is better to be alone than in bad company")</p>
  
  <p>New code</p>
  
  <pre><code>Sub DeleteSlideMasterShapes()
      Dim i As Long
      Dim shp As Shape
  
      With ActivePresentation
          For i = .Designs.Count To 1 Step -1
              For Each shp In .Designs(i).SlideMaster.Shapes
                  shp.Delete
              Next
          Next i
      End With
  End Sub
  
  Sub loopFiles()
  
  Dim fso As New FileSystemObject
  Dim fil As File
  Dim fold As Folder
  Dim yourfolder As String
  
  Set fold = fso.GetFolder(Application.ActivePresentation.Path)
  
  For Each fil In fold.Files
  
      If InStr(1, fil.Name, ".pptx") &gt; 0 Then
          Application.Presentations.Open fil.Path
  
          Call DeleteSlideMasterShapes
  
          ActivePresentation.Save
          ActivePresentation.Close
  
      End If
  
  Next fil
  
  End Sub
  </code></pre>