View Single Post
 
Old 05-10-2020, 01:05 PM
alex100 alex100 is offline Windows 7 64bit Office 2016
Advanced Beginner
 
Join Date: May 2020
Posts: 79
alex100 is on a distinguished road
Default Remove all the images in a document, including the new lines

I'm looking for a way to remove all the images in a document. I found this script...

Code:
Dim oILShp As InlineShape
For Each oILShp In ActiveDocument.InlineShapes
    ActiveDocument.Range(oILShp.Range.Start, oILShp.Range.End).Text = "[IMAGE REMOVED]"
Next
The problem is that I also need to remove the line where the image used to be, so that the paragraphs before and after the image will not be divided by a blank new line. Simply deleting the "[IMAGE REMOVED]" replacement text won't do that, as it will leave a new line in that spot.

What's the best way to do this, please?

Thank you,
Alex
Reply With Quote