When you create a TOC, Word bookmarks each referenced heading. You can see
these bookmarks if you display the Insert Bookmark dialog and check the
'Hidden bookmarks' checkbox -- you'll see a heap of bookmarks with names
like _toc123456789.
The 'Error! Bookmark not defined' message means that those bookmarks have
been removed (either directly, or by deleting the heading) since the
bookmark was last updated.
Internally, the TOC, if it includes the \h switch, contains a hyperlink
field (wdFieldHyperlink) for each text entry (with the \l switch, to
hyperlink to the bookmark), and a page ref field (wdFieldPageRef) for the
page number.
You can turn off the TOC hyperlinking by displaying the field code and
removing the \h switch.
You shouldn't need to run any VBA to convert hyperlinks in the downloaded
document: if you enter the hyperlink references as relative paths, they
remain that way. The confusing bit is only that Word's screentip always
displays the fully resolved path; but if you check the hyperlink's .Address
property you'll see that it is still stored as the original relative path.
> Hi,
>
[quoted text clipped - 45 lines]
>
> BBM
BBM - 22 Sep 2006 02:09 GMT
Thanks for the information.
I haven't had any luck entering a relative path to the linked documents.
All my linked documents are in the same folder as the document with the ToC.
But entering just the file name with the extension does not work. What
should a relative path to a word document in the same folder look like
(spaces embedded in the file name BTW)?
As far as I can tell, Insert Hyperlink creates a relative path (although one
with "%20%" seemingly replacing all the blanks (BTW I tried keying one of my
documents paths in the insert file dialog like this with no success either).
Insert File and then selecting link creates an absolute path.
Do you have any ideas about how the bookmarks could get removed? I
literally load the document into Word, rebuild the TOC, save the document,
and when I re-load it it's clobbered again.
Thanks again for your help.
BBM
> When you create a TOC, Word bookmarks each referenced heading. You can see
> these bookmarks if you display the Insert Bookmark dialog and check the
[quoted text clipped - 68 lines]
> >
> > BBM