![]() |
|
#5
|
|||
|
|||
|
Yes, I just did that, only with a slight modification to your idea.
The 'Find = ^g^p' pattern did not seem to find and replace all the images in the document. Although I am not 100% sure, I believe it failed to replace those images that were not followed by a new line/paragraph. Anyhow, I'm positive it was something related to how the image and the text that followed it were formatted in the source HTML page. The code below seems to work better, as I tested it quite well. Code:
Dim oILShp As InlineShape
For Each oILShp In ActiveDocument.InlineShapes
ActiveDocument.Range(oILShp.Range.Start, oILShp.Range.End).Text = "[IMAGE REMOVED]"
Next
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[IMAGE REMOVED]^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Alex |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How do I Remove A Specific Amount of Characters from Lines in a Document?
|
tatihulot | Word | 5 | 01-22-2016 05:55 AM |
How to Prevent Table of Contents Including Document Details
|
shaaa | Word | 5 | 06-10-2015 03:52 PM |
| How to stop including images as attachment (in other e-mail clients)? | TylerSD | Outlook | 0 | 12-05-2014 01:56 PM |
| hard lines across document - can't remove | joanieS | Word | 3 | 07-30-2013 11:29 AM |
| Remove all images from a Mac OS X Word 2008 Document? | qcom | Drawing and Graphics | 0 | 04-23-2011 06:48 PM |