ateneva
8/2/2018 - 12:19 PM

How do I remove certain shape types from a slide with VBA?

How do I remove certain shape types from a slide with VBA?

Sub Delete_shape_type()

Dim p As Presentation
Set p = ActivePresentation

Dim PPS As Slide
Dim Sh As Shape
'***************************

For Each PPS In p.Slides
    For Each Sh In PPS.Shapes
            
    If Sh.Type = msoPicture Then Sh.Delete
    If Sh.Type = msoTextBox Then Sh.Delete
    If Sh.Type = msoAutoShape Then Sh.Delete
    
    Next Sh
Next PPS

End Sub