Formatting Issues

Customize Table of Contents Field Codes and Formatting in Word for Mac

John WilsonJohn Wilson Nov 13, 2026 869 views

Question details

Customize a table of contents in Word for Mac using field codes and styles that retain formatting after updates.

Customize Table of Contents Field Codes and Formatting in Word for Mac
Product
Microsoft Word for Mac
Device & OS
macOS
Scenario
The user wants to control TOC hyperlinks, bookmark scope, text colors, and page numbers for selected levels.
Observed behavior
Direct formatting applied to generated TOC entries may be removed when the table is updated.
Before you start

Check which heading levels your table of contents includes and decide which levels need page numbers or different formatting. If you want to limit the table to part of the document, select that content and create a bookmark through Insert > Bookmark.

Solution 1Recommended

Edit TOC field switches and update the table

Use field switches to control hyperlinks, page numbers, and the scope of an existing table of contents.

1
Show the field code

Click the table of contents, then right-click or Control-click and choose Toggle Field Codes. If that command is unavailable, select the field and try Shift+F9; on some Macs, use Fn+Shift+F9.

2
Add the switches you need

In the displayed TOC field, add \h to create hyperlinks. Add \n "2-3" to omit page numbers for levels 2 through 3, adjusting the range as needed. For example, the field may read { TOC \o "1-3" \h \n "2-3" }.

3
Limit the scope if needed

To include entries only from a bookmarked portion of the document, add \b followed by the bookmark name, such as \b ChapterOne, to the TOC field.

4
Update and check

Right-click or Control-click the TOC field and choose Update Field, then update the entire table if prompted. Toggle field codes again if needed and check the links and page numbers.

Edit TOC field switches and update the table
Keep the existing field braces: Edit the code inside the existing field braces; typing ordinary braces does not create a Word field.
Free Microsoft Office alternative

Create and edit documents with tables of contents in WPS Writer

WPS Office is a free, lightweight alternative with a familiar interface for editing documents and working with tables of contents. Its Microsoft Word format compatibility helps you move existing documents into WPS Writer. It does not repair Word for Mac field-code or style issues.

Create and update tables of contents in WPS WriterOpen and edit Microsoft Word DOC and DOCX documentsUse a familiar interface for everyday document formattingMove existing Word documents into a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does my table of contents lose formatting when I update it?

Word regenerates TOC entries during an update, so direct formatting can be overwritten. Use Format > Style to modify TOC 1, TOC 2, and the other relevant TOC styles instead.

How do I make TOC entries hyperlinks in Word for Mac?

Toggle the TOC field code, add the \h switch inside the existing field, and choose Update Field. Update the entire table if prompted.

Can I remove page numbers for only some TOC levels?

Yes. Add a range to the \n switch in the TOC field. For example, \n "2-3" omits page numbers for levels 2 and 3 while leaving other levels unaffected.

How can I show a table of contents for just one section?

Select the section and create a named bookmark through Insert > Bookmark. Then add \b followed by that bookmark name to the TOC field and update the table.