Here’s a breakdown of why this happens, even if you're not linking to external files:
💡 Root Cause
When Word sees fields like:
xml
Copy
<w:fldSimple w:instr="TOC \o '1-3' \h \z \u"/>
or their equivalent complex field code forms (i.e., <w:fldChar>
with <w:instrText>
inside a run), it treats them as potentially dynamic fields that could:
Reference bookmarks
Reference hyperlinks (\h
switch)
Include external content (though in your case, it doesn’t)
Microsoft Word can't determine ahead of time whether those fields truly reference external content, so it plays it safe and shows that warning.
🧠 Why TOC Triggers It
Even a simple TOC like:
nginx
Copy
TOC \o "1-3" \h \z \u
triggers this because of:
\h
= hyperlinks (triggers "external reference" detection)
\u
= uses applied paragraph outline levels (can be dynamic)
\z
= hides page numbers in web layout view
➡️ The mere presence of \h
or any field that could update content dynamically causes this.
✅ Ways to Avoid or Mitigate
- Remove the
\h
switch
If you don't need hyperlinks in your TOC:
xml
Copy
<w:fldSimple w:instr="TOC \o '1-3' \z \u"/>
This reduces the chance that Word will think the field is external — though it may still prompt you in some cases.
- Use Static TOC Instead of Dynamic Fields
Instead of inserting a TOC field, generate the TOC manually (just text and page numbers). This removes all dynamic field references — but it becomes static and won’t update automatically.
- Accept the Prompt (It's Harmless)
If users understand the document doesn’t actually reference external files, you might leave the behavior as-is. It's common and expected with real TOCs.
Summary
Cause | Explanation |
---|---|
TOC field itself | Considered dynamic, might have hyperlinks |
TOC field itself | Considered dynamic, might have hyperlinks |
Word default behavior | Assumes any field might link externally |
No actual links needed | But still triggers warning due to field typeHere’s a breakdown of why this happens, even if you're not linking to external files: |