Document Editing Problems

How to Fix Nested Fields in Word Dynamic Hyperlinks

Aamir Naveed AkramAamir Naveed Akram Oct 26, 2026 871 views

Question details

The user is trying to create dynamic hyperlinks using nested fields but finds that DOCPROPERTY fields nested inside a HYPERLINK field are being automatically removed.

How to Fix Nested Fields in Word Dynamic Hyperlinks
Product
Word Processor
Device & OS
Windows and Mac
Scenario
Attempting to generate dynamic links in a document using nested document properties within hyperlink fields.
Observed behavior
The nested DOCPROPERTY field is stripped out of the HYPERLINK field, causing the hyperlink to revert to its original static URL.
Before you start

Press Alt + F9 (or Option + F9 on Mac) to toggle field codes on in your document so you can accurately view and edit the underlying HYPERLINK and nested field syntax.

Solution 1Recommended

Use a Mail Merge Hyperlink Approach

Instead of nesting DOCPROPERTY fields, which often break, use mail merge fields combined with the HYPERLINK field to reliably create dynamic URLs.

Nesting DOCPROPERTY fields directly inside a HYPERLINK field is a known limitation in many word processing versions, causing the field to revert to a static link. Transitioning to a mail merge setup resolves this by cleanly injecting dynamic data into the link structure.

1
Reveal field codes

Press Alt + F9 to reveal all field codes in your document so you can see the HYPERLINK formula.

2
Replace the DOCPROPERTY field

Delete the nested DOCPROPERTY code and insert a standard MERGEFIELD that points to your dynamic URL data source.

3
Structure the field correctly

Ensure your syntax looks similar to { HYPERLINK "{ MERGEFIELD URL_Field }" }. Make sure to use Ctrl + F9 to insert the curly brackets for the fields.

4
Remove MERGEFORMAT switches

Delete any \* MERGEFORMAT text from your field codes, as these switches can interfere with dynamic link generation.

5
Update and test

Press Alt + F9 again to hide the field codes, select the hyperlink, and press F9 to update the field and test the dynamic URL.

Use a Mail Merge Hyperlink Approach
Field Code Brackets: Always use Ctrl + F9 (Cmd + F9 on Mac) to insert field code brackets { }. Typing standard curly braces on your keyboard will not create a functional field code.
WPS Writer Solution

Create Dynamic Hyperlinks Easily with WPS Office

WPS Writer simplifies the creation of dynamic links through its robust Mail Merge features, allowing you to bypass complex nested field issues found in other word processors while maintaining full document compatibility.

  1. 1. Open your document in WPS Writer: Launch WPS Office and open your existing document or start a new one.
  2. 2. Access the Mail Merge features: Navigate to the Mailings tab on the top ribbon and click on Open Data Source to connect your dynamic URL data.
  3. 3. Insert a dynamic hyperlink: Use the Insert Merge Field button to place your URL data directly into the document, easily formatting it as a hyperlink without relying on fragile nested codes.
Fully compatible with Microsoft Word DOC and DOCX file formatsIntuitive Mail Merge interface for injecting dynamic data into hyperlinksLightweight and fast performance on both Windows and Mac operating systemsFree to use with comprehensive document editing features
microsoft office alternative - wps office

Frequently Asked Questions

Why does my nested DOCPROPERTY disappear inside a hyperlink?

In many word processor versions, nesting a DOCPROPERTY field directly inside a HYPERLINK field causes the field code to break during document updates. The application automatically strips the nested property to resolve the conflict, which causes the link to revert to its original static URL.

How do I view the underlying hyperlink field codes?

You can reveal the hidden field codes in your document by pressing Alt + F9 on Windows or Option + F9 on a Mac. This allows you to manually read and edit the raw HYPERLINK and MERGEFIELD syntax.

What does the MERGEFORMAT switch do in a hyperlink field?

The \* MERGEFORMAT switch instructs the word processor to retain the previous formatting of the field whenever it is updated. However, in complex nested hyperlinks, it can cause formatting conflicts and is generally recommended to be removed.

Can I use specific display text for a mail merge hyperlink?

Yes, you can set a literal display text for your dynamic hyperlink. This text is managed in the Insert Hyperlink dialog box and remains visible to the reader even when the underlying dynamic field codes are hidden.