View Single Post
 
Old 03-01-2024, 07:07 AM
Italophile Italophile is offline Windows 11 Office 2021
Expert
 
Join Date: Mar 2022
Posts: 554
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

It is really very simple. You just need to make a simple modification to the code that you already have.

Code:
Sub DeleteAllShapes()
    Dim oShape As Shape
    Dim i As Integer
    For i = ActiveDocument.Shapes.Count To 1 Step -1
        ActiveDocument.Shapes(i).Delete
    Next i
    For i = ActiveDocument.InlineShapes.Count To 1 Step -1
        ActiveDocument.InlineShapes(i).Delete
    Next i
End Sub
The golden rule when getting code from the internet, even a forum like this one, is never use what you don't understand. So, please take some time to learn what the code you have been given is doing. Not only will this help you avoid potential disasters, it will also help you to modify code to suit your purpose.
Reply With Quote