View Single Post
  #5   Report Post  
olegnaumov olegnaumov is offline
Junior Member
 
Posts: 0
Default

Quote:
Originally Posted by olegnaumov View Post
It works well, but for some reason it fails to delete Autoshapes placed inside Drawing Canvas. Could you help with that?
Update:

Never mind! Here's the code:
Code:
Dim oShp As Shape
Dim oFrm As InlineShape

Dim nCount As Long


For nCount = ActiveDocument.Shapes.Count To 1 Step -1
    Set oShp = ActiveDocument.Shapes(nCount)
   
    If oShp.Type = msoAutoShape Then
        oShp.Delete
    Else
        If oShp.Type = msoCanvas Then
            For i = oShp.CanvasItems.Count To 1 Step -1
                If oShp.CanvasItems(i).Type = msoAutoShape Then
                    oShp.CanvasItems(i).Delete
                End If
            Next i
        End If
    End If
    
    MsgBox ("Job's done!")
Next nCount