How to Bulk Update Linked Image Paths in Word Documents
Question details
The user needs to update the file paths for multiple linked inline images in a Word document after moving the source image files from subfolders to a parent directory.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Moving referenced image files to a new directory and needing to correct the links in bulk without doing it manually one by one.
- Observed behavior
- Linked images fail to load or display broken links because the source files were moved, and the document is still searching for them in the old subfolder paths.
Ensure you have created a backup copy of your Word document and noted the exact old and new folder paths before running any macros.
Use a VBA Macro to Bulk Update Image Paths
Running a VBA macro is the most efficient method to loop through all inline shapes in your document and automatically replace the outdated folder paths with the new directory.
This method involves writing a short script that identifies all images linked as inline shapes and executes a text replacement on their source paths. It is highly recommended for documents containing dozens or hundreds of images.
Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor in Word.
Click on 'Insert' in the top menu and select 'Module' to open a blank script window.
Write a script that loops through 'ActiveDocument.InlineShapes'. For each shape where 'Type = wdInlineShapeLinkedPicture', use the 'Replace' function on 'LinkFormat.SourceFullName' to change the old path (e.g., 'D:\!PIM\vol1\') to the new path (e.g., 'D:\!PIM\').
Press F5 or click the 'Run' button in the toolbar to execute the script and update all linked paths in the background.
Return to your document, press Ctrl + A to select all text, and press F9 (or Fn + F9 on Mac keyboards) to refresh the fields and display the relocated images.

A Seamless Alternative for Document Editing
If managing broken image links and running complex macros in Microsoft Word feels overwhelming, try WPS Office. It provides a free, lightweight, and highly compatible platform that makes document formatting and image management effortless.

Frequently Asked Questions
Why are my linked images showing up as red X's or blank boxes?
This usually happens when the source image files are moved, renamed, or deleted, causing the linked path in your Word document to break. The document can no longer find the files at the original location.
Can I update linked image paths without using a VBA macro?
Yes. You can go to File > Info, look for 'Edit Links to Files' in the bottom right corner, and manually change the source path for each image. However, for bulk updates across many images, a macro is significantly faster.
Why did pressing F9 not refresh my linked images?
If F9 does not work, ensure you have selected the entire document (using Ctrl + A) first. On some laptops and Mac keyboards, the function keys are locked, so you may need to press Fn + F9 to trigger the refresh command.




