Macro to delete between bookmarks

M

Marty

In Word97, can a macro be written such that it will delete all text between 2
bookmarks?

Thanks,

Marty
 
D

Dave Lett

Hi Marty,

You can use something like the following:

Dim oRng As Range
With ActiveDocument
Set oRng = .Range _
(Start:=.Bookmarks("bk1").Range.End, _
End:=.Bookmarks("bk2").Range.Start)
oRng.delete
End With

HTH,
Dave
 
M

Marty

Hi Dave-

Thanks. It worked!!!! (sort of)

My bookmarks did not carry across from the template to the document, but
I'll post this as a separate question.

But, it did delete the text between the bookmarks when I tested it in a new
document which was not generated in a merge.

Thanks.

-Marty
 

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