How to Extract Images from Word Documents Using VBA and Alternatives
Question details
The user wants to save embedded graphics from a Microsoft Word document as PNG files using VBA and needs to identify the correct Office commands to export selected objects.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Attempting to programmatically extract graphics or images from a Word document and save them locally as PNG files.
- Observed behavior
- Word does not provide a simple, direct VBA method or built-in command for exporting every graphic simultaneously as individual image files.
Ensure your document is saved in the modern .docx format rather than the older .doc format, as .docx files natively store internal assets in a structured directory that makes manual extraction much easier.
Extract Images by Renaming the Document to ZIP
Since VBA lacks a direct image export method, changing the file extension to ZIP is the most effective workaround to extract all original, high-quality images simultaneously.
A .docx file is essentially a compressed package of XML files and media assets. By changing its extension to .zip, you can access the internal directory and retrieve the exact image files embedded in the document without writing complex VBA scripts.
Duplicate your .docx file into a new folder to preserve the original document and avoid accidental data loss.
Right-click the copied file, select 'Rename', and change the '.docx' file extension to '.zip'. Confirm the prompt warning you about changing file extensions.
Right-click the newly created .zip file and select 'Extract All' using Windows Explorer, or use a preferred archiving tool to unzip the contents.
Open the extracted folder and navigate to the 'word' directory, then open the 'media' folder. All embedded images will be listed here in their native formats, such as PNG or JPEG.

Save the Document as a Web Page
Using the 'Save as Web Page' feature forces Word to output the document layout and export all embedded graphics into a designated external folder.
Identify Office Commands for VBA Customization
If you are developing custom VBA solutions, you may need to find specific Ribbon command IDs to trigger built-in Office behaviors programmatically.
Easily Manage and Extract Images with WPS Office
WPS Office offers intuitive, built-in features to save images directly from your documents without relying on complex VBA scripts or external extraction tools.
- 1. Open your document: Launch WPS Writer and open the .docx file containing the images.
- 2. Select the target image: Scroll to the graphic you want to extract and click on it to highlight the image.
- 3. Trigger the save command: Right-click the highlighted image and select 'Save as Picture' from the context menu.
- 4. Choose format and save: Select PNG from the file format dropdown, choose a destination on your device, and click 'Save'.

Frequently Asked Questions
Why can't I directly export all images using a single VBA command in Word?
Microsoft Word's VBA object model does not include a native method specifically designed to bulk export embedded inline shapes or graphics as individual image files to a local drive. Workarounds, such as saving as HTML or renaming the file to ZIP, are typically required.
Is there a way to automate saving as a web page using VBA?
Yes, you can write a VBA macro that uses the `Document.SaveAs2` method with the parameter `FileFormat:=wdFormatHTML`. This will programmatically save the document as a webpage, forcing Word to extract the embedded images into an associated folder automatically.
How do third-party applications like Snagit help with image extraction?
Third-party image utilities like Snagit allow you to bypass Word's limitations entirely by capturing high-quality graphics directly from your screen or by using specific application plugins to parse and extract media assets seamlessly.




