Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Macro to delete between bookmarks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marty - 02 Feb 2005 15:41 GMT
In Word97, can a macro be written such that it will delete all text between 2
bookmarks?

Thanks,

Marty
Dave Lett - 02 Feb 2005 16:21 GMT
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

> In Word97, can a macro be written such that it will delete all text between 2
> bookmarks?
>
> Thanks,
>
> Marty
Marty - 02 Feb 2005 17:07 GMT
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

> Hi Marty,
>
[quoted text clipped - 18 lines]
> >
> > Marty
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.