View Single Post
 
Old 12-12-2011, 08:49 AM
AlmostFriday AlmostFriday is offline Windows XP Office 2007
Novice
 
Join Date: Dec 2011
Posts: 8
AlmostFriday is on a distinguished road
Default Delete all shapes but not the images - Possible?

I am trying to create a macro to delete lines (the length of the line varies, but, the width is always set to 0 cm) that have been added to a page, but, every variance I put in, still deletes all the shapes including pictures that I want left in.
I am using the following code:

Dim iShp As Word.Shape
For Each iShp In ActiveDocument.Shapes
With iShp
If iShp.Width = 0 Then
iShp.Delete
End If
End With
Next

For i = ActiveDocument.Shapes.Count To 1 Step -1
ActiveDocument.Shapes(i).Delete
Next i


Is there a way round this so the pictures/illustrations are left in?
Reply With Quote