Bookmarks, recalling 'by location'

R

Roy Lasris

I want to create a listing of bookmarks in my document in the order in which
they appear.

"For Each oBookmark in ActiveDocument.bookmarks" returns only in alphabetical
order. this is true even if I preceed the instruction with:
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByLocation
End With

(the instruction accompanying 'default sorting' say this will be so.)

Is there a work around. 'SortbyLocation' is important to me.

Roy
 
C

Charles Kenyon

I'm not sure but you could try cycling through them by index number to the
count rather than for each. I suspect it will give you the marks by location
front to back, but it may be by creation order or may end up replicating
alphabetical order, but worth a try.
 
C

Cindy M -WordMVP-

Hi Roy,
I want to create a listing of bookmarks in my document in the order in which
they appear.

"For Each oBookmark in ActiveDocument.bookmarks" returns only in alphabetical
order.
Take a really close look at the VBA Help topic on bookmarks. Then try with
ActiveDocument.RANGE.Bookmarks

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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