Table of Contents

B

beanbabe

Hi

i have my standard word doucment which has a Table of Contents in it. the
trouble i have is when i merge this document with my data which is in excel
and i am merging via OLE, it messes up my Table of Contents all the links
break down. Please can someone advise of a workaround for this.

Thanks
 
D

Doug Robbins - Word MVP

There are a number of Fields that (for good reason) do not survive the mail
merge process. The alternative is to create a "roll-your-own" vba
equivalent to mail merge where in place of a mail merge main document
containing the merge fields, you use a template containing DOCVARIABLE
fields and you use vba to iterate through the data source, creating a new
document from the template for each record in the data source, setting the
values of document variables in each letter to the values from the current
record, updating the fields in the document so that the data is displayed in
the DOCVARIABLE fields and then saving and closing the document before
repeating the process for the next and each subsequent record.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
B

beanbabe

When you perform a mail merge to a new document, and the main document
contains a table of contents or a table of figures, you receive the following
error message, instead of page numbers, when you update the table:
ERROR! Bookmark not defined
Indexes and tables of authorities are not affected by this problem.

This does not happen when you perform the mail merge directly to the
printer. To work around this problem, use any of the following methods.
Method 1
Unlink the table of contents before merging to a new document. This converts
the TOC field to actual text, and the table of contents can no longer be
updated. If you want to update the table of contents, you must reinsert it.

Follow these steps to unlink the table of contents:
1. Place the insertion point within the table of contents.
2. Press CTRL+SHIFT+F9 (Windows), or the COMMAND key+SHIFT+F9 (Macintosh).
Method 2
Insert the table of contents after merging to the new document.
Method 3
Merge directly to the printer, instead of merging to a new document.
 

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