fields.update in macro does not update TOC

J

Jaspar

My template has a TOC and at the end of my AutoNew macro I have included the
statement ActiveDocument.Fields.Update, because the TOC includes some text
(headings) that contain text inserted with the AutoNew macro.

The problem is that the text apparently is not updated in the TOC. One
heading contains the name of a person ("Personal objectives for Peter") -
this name is inserted during AutoNew - but the TOC only shows "Personal
objectives for ".

If I update the fields manually (rightclicking TOC, choosing Update field
and Update evreything) the TOC is OK - so I thought the problem might be
related to some missing parameter for the ActiveDocument.Fields.Update
statement, but I can't see any possible parameters.
 
D

Dave Lett

Hi Jaspar,

You might have to specifically update the TOC.

ActiveDocument.TablesOfContents(1).Update

HTH,
Dave
 
J

Jaspar

Worked like a charm - thanx Dave!

Dave Lett said:
Hi Jaspar,

You might have to specifically update the TOC.

ActiveDocument.TablesOfContents(1).Update

HTH,
Dave
 

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