View Single Post
 
Old 12-13-2011, 05:04 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi AlmostFriday,

Quote:
I tried the code, but it still deletes the images
That's odd - it should only delete Word's own autoshape objects. Of course, if the pictures are in textboxes, they'd get deleted. Are you sure you haven't got some other code in there?


Here's an alternative routine you might try:
Code:
Dim Shp As Shape
For Each Shp In ActiveDocument.Shapes
  With Shp
    If .TextFrame.TextRange.InlineShapes.Count = 0 And _
      .Type <> msoLinkedPicture And .Type <> msoPicture Then .Delete
  End With
Next
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote