In Microsoft Word, automatic tables of contents rely on dynamic field codes and hidden bookmark pointers (such as _Toc12345678) to track headings and page numbers. When a heading is deleted, cut and pasted improperly, or overwritten with unformatted text, Word cannot locate the underlying reference target. When updating the document or converting it to PDF, the table of contents displays the disruptive inline message: Error! Bookmark not defined.
Identify Missing References and Update the Entire Table
Before manually editing bookmarks, forcing a complete document field refresh frequently rebuilds intact heading indices automatically:
- Open your document in Microsoft Word.
- Click anywhere inside the Table of Contents to highlight the container.
- Press F9 on your keyboard (or right-click the table and choose Update Field).
- In the prompt that appears, select Update entire table rather than “Update page numbers only”.
- Click OK. If the referenced heading was simply moved to a different page, this refreshes the pointer and removes the error.
Restore Heading Styles to Problematic Sections
If updating the table still leaves “Error! Bookmark not defined”, the source paragraph has lost its structural heading style designation:
- Scroll to the section in your document corresponding to the failed table of contents line.
- Highlight the section heading text.
- In the Home tab of the ribbon, inspect the Styles gallery.
- Reapply the appropriate style (such as Heading 1, Heading 2, or Heading 3). Avoid using manual bolding or font size changes without an assigned Heading style.
- Return to the Table of Contents, press F9, select Update entire table, and click OK.
Toggle Field Codes to Inspect Broken Bookmark Anchors
Word allows users to view the underlying field syntax to detect orphaned hyperlink bookmarks:
- Press Alt + F9 (or Option + F9 on macOS) to toggle field code display.
- The table of contents will transform into syntax such as
{ TOC \o "1-3" \h \z \u }, and individual hyperlinks will reveal{ PAGEREF _Toc12345678 \h }. - Navigate to the line showing the error. Notice whether the target bookmark name corresponds to an existing heading.
- To re-link manually: navigate to the destination heading in your document, select Insert > Bookmark, assign a clean name (e.g., ChapterTwoIntro), and click Add.
- Return to the table, update the field code with the new bookmark name, and press Alt + F9 again to exit field code view.
Recreate the Table of Contents Container
If legacy edits or mixed revisions from multiple authors have corrupted the hidden bookmark table beyond repair, replacing the TOC block resolves the fault in seconds:
- Click the table of contents handle in the upper-left corner of the container.
- Press Delete to remove the existing table.
- Go to the References tab in the ribbon.
- Click Table of Contents and select Automatic Table 1 or Automatic Table 2.
- Word immediately scans the entire document structure and generates fresh, uncorrupted bookmark targets.