View Single Post
 
Old 05-11-2020, 01:53 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Really, that is awful code - all you've done is cobble something together using the macro recorder and tacked it onto the end of your already defective code. If, as you say, some images were not removed, your solution is hardly any better, as those very same images will instead still display '[IMAGE REMOVED]'. All you need is:
Code:
With ActiveDocument.Range.Find
  .Execute FindText:="^g^p", ReplaceWith:="", Wrap:=wdFindContinue, Replace:=wdReplaceAll
  .Execute FindText:="^g^l", ReplaceWith:="", Wrap:=wdFindContinue, Replace:=wdReplaceAll
  .Execute FindText:="^g", ReplaceWith:="", Wrap:=wdFindContinue, Replace:=wdReplaceAll
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote