How to Insert Multiple Pictures in Word with File Names as Captions
Question details
The user wants to insert several images into a Word document and automatically add each image's file name below it as a caption.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Creating a document, report, or photo gallery requiring multiple images with their respective file names as automated labels.
- Observed behavior
- Word lacks a native, one-click feature to insert multiple pictures and automatically caption them with their file names, requiring manual entry or advanced workarounds.
Ensure all your images are saved in a single accessible folder and renamed exactly as you want them to appear in the captions.
Use a VBA Macro to Automate Image Insertion and Captions
Running a custom VBA macro is the most reliable way to bypass Word's limitations and automatically generate captions from file names for multiple images.
Microsoft Word does not have a built-in command for this specific task. However, Visual Basic for Applications (VBA) allows you to write a script that loops through a folder, inserts each picture, and appends the file name below it as a text caption.
In your Word document, press 'Alt + F11' on your keyboard to open the Microsoft Visual Basic for Applications window.
Click on 'Insert' in the top menu bar, then select 'Module' to create a blank script window.
Paste a standard macro code designed for inserting images with captions (available on MS Office forums). The code typically uses the 'InlineShapes.AddPicture' method combined with extracting the file name string.
Press 'F5' or click the 'Run' button. If prompted by the script, select the folder containing your images to execute the automated insertion.

Use a Specialized Photo Gallery Template
If you are not comfortable using VBA code, downloading a third-party document-automation template provides a straightforward, interface-driven alternative.
Try WPS Office for Seamless Document Editing
If dealing with macros and limited built-in features in Microsoft Word is slowing you down, consider switching to WPS Office. It is a free, highly compatible, and lightweight suite that handles standard document processing smoothly without complex configurations.
- 1. Download the Installer: Visit the official WPS Office website and download the free version for your operating system.
- 2. Install WPS Office: Run the downloaded file and follow the on-screen instructions to complete the fast installation.
- 3. Open Your Document: Launch WPS Writer and open your existing Word documents to enjoy seamless editing and formatting.

Frequently Asked Questions
Can I automatically caption images using Word's built-in Insert feature?
No, Microsoft Word does not have a native feature to automatically generate captions based on file names when inserting multiple pictures. You must rely on a VBA macro or specialized templates to automate this process.
How do I remove the file extension from the automatic captions?
If you are using a VBA macro, the code can be easily modified using a string manipulation function (like the 'Replace' function or 'InStrRev') to strip the '.jpg' or '.png' extension from the file name before inserting it as text.
Will the VBA macro method work on Word for Mac?
VBA support on Word for Mac has some limitations and differences in file path structures compared to Windows. A macro written for Windows might need adjustments, specifically in how it references folder paths and file directories, to work properly on macOS.
Does WPS Writer have a built-in feature for this?
Like Microsoft Word, WPS Writer currently focuses on manual insertion and captioning for granular control. Advanced batch-automation with dynamic file name captions generally requires third-party macro integrations.




