Update Multiple TOCs with Macro

S

Scott A

I have a document template with four TOCs (actually, one
TOC, a list of tables, list of figures, and list of
appendices).

I would like to create a macro that updates all four.

I've tried
Selection.WholeStory
Seleection.Fields.Update

as well as

ActiveDocument.TablesOfContents(1).Update

Neither macro updates all four tables.

Are there any recommendations?
 
D

Doug Robbins - Word MVP

Hi Scott,

Use:

Dim i As Integer
For i = 1 To ActiveDocument.TablesOfContents.Count
ActiveDocument.TablesOfContents(i).Update
Next i
For i = 1 To ActiveDocument.TablesOfFigures.Count
ActiveDocument.TablesOfFigures(i).Update
Next i

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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