Update Table of Contents

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Word 2000 SP3

Is it possible to change the default setting of the Update Table of Contents
options from "Update page numbers only" to "Update entire table" instead?

Many thanks in advance of your assistance.
DeanH
 
You can't really change the default, but you can install this macro
and assign a toolbar button and/or keyboard shortcut to it.

Sub UpdateTableOfContents()
Dim toc As TableOfContents

For Each toc In ActiveDocument.TablesOfContents
toc.Update
Next
End Sub

See http://www.gmayor.com/installing_macro.htm,
http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToHotkey.htm
and
http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm
if needed.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
Jay, many thanks for your help.

To add:
This macro obviously only updates the tables, how about the cross-references?
My usual process is Ctrl-A, F9, then update entire TOC x3.
This updates all cross-references, Figure & Table numbering, TOC and List of
Figures & Tables.

Again many thanks.
Have a good day.
DeanH
 
This should update all the fields (including those in headers, footers,
footnotes, etc.) and then all the tables. If you have any tables of
authorities (for legal briefs and such), you'd need another For Each loop
for those.

Sub UpdateTableOfContents()
Dim toc As TableOfContents
Dim oStory As Range
On Error Resume Next
For Each oStory In ActiveDocument.StoryRanges
Do
oStory.Fields.Update
Set oStory = oStory.NextStoryRange
Loop Until oStory Is Nothing
Next

For Each toc In ActiveDocument.TablesOfContents
toc.Update
Next

For Each toc In ActiveDocument.TablesOfFigures
toc.Update
Next
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Jay, fantastic. Many thanks for your very useful help.
All the best.
DeanH
 
Just to stay honest... There's a buglet in that code that prevents it from
updating any Table of Figures. To fix it, add the line

Dim tof As TableOfFigures

after the Dim toc line, and change the last loop to this:

For Each tof In ActiveDocument.TablesOfFigures
tof.Update
Next

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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

Back
Top