Updating an Entire Table of Contents

Written by Allen Wyatt (last updated June 22, 2024)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021


Whenever Jim chooses to update a Table of Contents, he is presented with a dialog box that asks if he wants to update pages only or the entire table. Jim always wants the entire table updated, so he wonders if there is a way to bypass the dialog box entirely or, failing that, have the "entire table" option be the default.

There is no way to bypass the dialog box, and it doesn't appear that the dialog is even accessible via a macro. You can, however, use a macro to update all of the Tables of Contents in your document. Here is an example of such a macro, and it requires surprisingly few lines of code:

Sub UpdateAllTOCs()
    Dim t As TableOfContents

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

The macro steps through each of the TOCs in your document (the one that is currently active) and updates them. The .Update method updates the entire table, not just the page numbers. If, for some reason, you want the macro to update just page numbers, then you would use the .UpdatePageNumbers method instead.

One tangential benefit of the macro is that you don't need to be anywhere near the Tables of Contents in your document in order to update them. Run the macro, and it steps through each of them regardless of where they are in the document, without changing your position within the same document.

To make the macro more accessible, of course, you could assign it to a shortcut key or you could add it to your Quick Access Toolbar.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (10274) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Screen Flip Flop with VBA

Word allows users to conveniently work with multiple documents at the same time. When writing macros, you may need to ...

Discover More

Counting Alphabetic Characters in a String

Need to find out how many times a certain letter appears in a text string? It's easy to do if you rely on the SUBSTITUTE ...

Discover More

Widening a Column to a Particular Cell's Width

Do you want to set a column's width based on whatever is in the currently selected cell? There are actually a number of ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Adding Column Headings to a Table of Contents

Word makes it easy to create a Table of Contents. If you want column headings in that table, getting them takes a bit of ...

Discover More

Customized Tables of Contents

Generating a table of contents is easy in Word. Changing how that table of contents looks is also easy, provided you ...

Discover More

Problems with TOC Styles

If you generate a table of contents for your document, there may be some unexpected surprises in the way the TOC appears. ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine minus 2?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.