Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
sheqman
 
Posts: n/a
Default Strange Problem with PAGEREF and Table of Contents in Word

I have a program that takes data from an Excel spreadsheet and inserts
into a series of word documents using a mailmerge powered by VBA. I
should note that the mailmerge documents are created from templates.
(i.e. the program creates a document from a word template, then applies
the mail merge to that document and outputs the merged document as a
new document which then gets saved.)

Everything works ok except for one legal document that contains a
Word-generated Table of Contents. The original template has the TOC and
updates it when the document opens. However, when a new document is
created based on this template, the TOC in the new document gets
corrupted. Basically, it creates PAGREF field codes for each entry in
the TOC and loses the TOC functionality. This wouldn't be a problem
except that I have another script that takes the merged word docs and
outputs them to PDF. When the script encounters the document in
question, it replaces the PAGEREF codes with "Error! Bookmark not
defined." Obviously this make the resulting document unusable.

Anyway to get around this problem?

Thanks in advance for your help,

Rasheq

 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table of contents begins renumbering at every section break frangardengirl Tables 4 February 18th 06 06:21 PM


All times are GMT +1. The time now is 06:26 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"