Generating own TOC with well-defined bookmark names

T

tvamvarg

Hi,
I'd like to generate a TOC where the bookmark names are based on the actual
heading (instead of the format "_TOC<some random number>" as used by
default). The reason is I want to keep the bookmark names even if I
re-generate the TOC, in order to be able to create external hyperlinks to
chapters within the document (if you regenerate the default TOC, the 'random
numbers' will change and make your external hyperlinks unusable).

It is much too cumbersome to create own bookmarks manually, the document is
a large one...

I'd be so grateful for any suggestions. I never did any macro programming or
VBA, but I am not new to programming. My Word version is 2003. Thanks!!!
 
P

Petter

Actually, the only thing I think I need to do to accomplish what I want is
this (some pseudo-code):

for all headings {
create bookmark (bookmark name = heading text)
}

Could someone describe to me what this would look like in VBA?

Thanks!!
 

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