Document Editing Problems

How to Insert Multiple Pictures in Word with File Names as Captions

Algirdas JasaitisAlgirdas Jasaitis Nov 2, 2026 868 views

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.

How to Insert Multiple Pictures in Word with File Names as Captions
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.
Before you start

Ensure all your images are saved in a single accessible folder and renamed exactly as you want them to appear in the captions.

Solution 1Recommended

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.

1
Open the VBA Editor

In your Word document, press 'Alt + F11' on your keyboard to open the Microsoft Visual Basic for Applications window.

2
Insert a New Module

Click on 'Insert' in the top menu bar, then select 'Module' to create a blank script window.

3
Paste Macro Code

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.

4
Run the Macro

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 VBA Macro to Automate Image Insertion and Captions
Macro Security: You may need to enable macros in Word's Trust Center settings (File > Options > Trust Center > Trust Center Settings > Macro Settings) before running the VBA script.
Free Microsoft Office 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. 1. Download the Installer: Visit the official WPS Office website and download the free version for your operating system.
  2. 2. Install WPS Office: Run the downloaded file and follow the on-screen instructions to complete the fast installation.
  3. 3. Open Your Document: Launch WPS Writer and open your existing Word documents to enjoy seamless editing and formatting.
Fully compatible with Microsoft Word (.docx, .doc) formatsFree and lightweight office suite with a fast installation processFamiliar, user-friendly interface that requires zero learning curveBuilt-in robust tools for advanced document and image formatting
microsoft office alternative - wps office

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.