Macro to delete between lines

M

Marty

Hi-

I thank everyone who has been helping me.

Sorry to be a pest, but I have not yet figured out how to do this.

I have a Word97 document with "#111#" and a few pages later, I have "#222#".

Can a macro be written to delete everything from #111# to #222#?

No matter what I try, I get run-time error 438 "Object doesn't support this
opperation or method."

Thanks,

Marty
 
D

Dave Lett

Hi Marty,

The following will delete everything from #111# to #222# including #111# and
#222#

With Selection
.HomeKey Unit:=wdStory
.Find.Execute FindText:="#111#"
.ExtendMode = True
.Find.Execute FindText:="#222#"
.delete
End With

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top