I know but that's the only solution that worked to delete the lines of text in the document. So I'm just going with it.
The "only" solution? Sorry, but that is utter nonsense.
However, you seem to want to persist in ignoring any suggestions regarding this, so...hey...if you are happy with it, who is to argue?
I hope nothing is ever changed (added/deleted), or the document is never opened on a different machine. Your hard-coded number could very well be off.
BTW: unless you need it for something else - what I don't know, as you
delete it - declaring, setting your range object is rather pointless.
Code:
ActiveDocument.Paragraphs(#).Range.Delete
does it all on its own, without using a Range object.
So...you manually count the paragraphs to pin-point the desired paragraph, then hard-code that to delete the paragraph by code. As Tony pointed out, the challenge is to find a less efficient method.
Only solution? Hardly. I suggested using a bookmark, but you ignore that. Using a bookmark would allow you to delete ANY set piece of text, regardless of where it is, where it may be moved to, or how Word may place it using a different printer driver.
Whatever...
faq219-2884
Gerry
My paintings and sculpture