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.