How to Use MERGEFIELD Inside INCLUDEPICTURE in Word Mail Merge
Question details
The user needs to successfully nest a MERGEFIELD within an INCLUDEPICTURE field to dynamically insert images during a Word mail merge.

- Product
- Microsoft Word
- Device & OS
- Windows, macOS
- Scenario
- Creating a mail merge document that requires dynamic images based on a data source field.
- Observed behavior
- Nested field codes may fail to display images correctly, especially on macOS or when using older Word 97 formats, requiring exact file paths and syntax.
Ensure you have the exact file paths for all images stored in your data source and update your Microsoft Word software to the latest version to avoid compatibility issues.
Verify Nested Field Codes and Use Absolute Image Paths
Correctly formatting the nested field codes and providing the full absolute path to the images is crucial for the INCLUDEPICTURE field to function properly.
When nesting fields in Microsoft Word, the syntax and spacing must be exact. Furthermore, relative paths often cause the mail merge to fail when generating the final document, so absolute paths are highly recommended.
Press Alt + F9 (or Option + F9 on a Mac) to toggle and reveal the underlying field codes in your Word document.
Press Ctrl + F9 (Cmd + F9 on Mac) to insert a new set of field code brackets, and type INCLUDEPICTURE inside them.
Inside the INCLUDEPICTURE quotes, press Ctrl + F9 again to insert another set of brackets and type MERGEFIELD followed by your data source column name (e.g., MERGEFIELD ImagePath).
Ensure your Excel or database data source contains the complete, absolute drive or network path for each image (e.g., C:\\Images\\photo.jpg) instead of just the file name.
Press Alt + F9 to hide the codes, finish your mail merge, then select all text (Ctrl + A) and press F9 to update the fields and render the images.

Utilize a Mail Merge Add-in for Advanced Image Merging
If native nested fields continue to fail, a dedicated mail merge add-in can simplify inserting dynamic images and generating separate files.
Use WPS Office for a Smoother Mail Merge Experience
If you are struggling with complex nested field codes and format compatibility issues in Microsoft Word, WPS Office provides a highly compatible, easy-to-use alternative. Enjoy a familiar interface and robust mail merge features without the steep price tag.
- 1. Download and Install: Get WPS Office for free from the official website and install it on your Windows or macOS device.
- 2. Open Your Document: Launch WPS Writer and open your existing Word document directly without losing formatting.
- 3. Start Mail Merge: Navigate to the References tab and use the intuitive Mail Merge feature to connect your spreadsheet easily.

Frequently Asked Questions
Why is my INCLUDEPICTURE field showing a red X instead of the image?
This usually happens if the image path in your data source is incorrect, relative, or inaccessible. Ensure you provide the complete, absolute path (including the drive letter or network location) in your data source.
Do I need to update the field codes after completing the mail merge?
Yes. After completing the merge, you often need to select all text in the generated document (Ctrl + A or Cmd + A) and press F9 to force Word to update the INCLUDEPICTURE fields so the images render correctly for each record.
Can I use relative paths for INCLUDEPICTURE in a mail merge?
While technically possible using additional formatting tricks, relative paths in Word mail merges are highly prone to breaking, especially when the final document is saved in a different location. It is strongly recommended to use absolute paths.
Why does my nested field code fail on Mac but work on Windows?
macOS and Windows use different file path structures (slashes vs. backslashes) and directory roots. Ensure your data source uses the correct path format native to the operating system where you are performing the mail merge.




