Re: Listing Bookmark By Location in Document by MT
MT
Fri Jun 25 21:11:02 CDT 2004
Jonathan,
Thanks for your help. I knew there had to be a way to do it, but I wasn't
having much luck finding it in the online Help.
-- Tom
MT DOJ Help Desk
Making the world a safer place.
"Jonathan West" <jwest@mvps.org> wrote in message
news:uVQtFloWEHA.3800@TK2MSFTNGP11.phx.gbl...
>
> "MT DOJ Help Desk" <NoEmail@Please.com> wrote in message
> news:%231nN5IoWEHA.384@TK2MSFTNGP10.phx.gbl...
> > Word 2000
> >
> > I have a simple macro that populates an array with bookmark names by
> reading
> > the contents of the Bookmarks collection. The only problem is that it
> fills
> > the array with the bookmark names in alphabetical order, and I need them
> > listed in the order in which they appear in the document from top to
> bottom.
> > Is there a way to sort the Bookmarks collection by location, and then
use
> > that sorted list to populate an array?
>
> Hi Tom
>
> This goes through the bookmarks alphabetically
>
> Dim oBookmark
> For Each oBookmark in ActiveDocument.Bookmarks
> 'your code here
> Next oBookmark
>
> and this goes through the booknmarks in the order they appear in the
> document
>
> Dim oBookmark
> For Each oBookmark in ActiveDocument.Range.Bookmarks
> 'your code here
> Next oBookmark
>
>
> --
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>