logo
search
VBA & Macro Problems

How to Extract Images from Word Documents Using VBA and Alternatives

Algirdas JasaitisAlgirdas Jasaitis Oct 14, 2026 871 views

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.

How to Extract Images from Word Documents Using VBA and Alternatives
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.
Before you start

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.

Solution 1Recommended

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.

1
Create a copy of the document

Duplicate your .docx file into a new folder to preserve the original document and avoid accidental data loss.

2
Rename the file extension

Right-click the copied file, select 'Rename', and change the '.docx' file extension to '.zip'. Confirm the prompt warning you about changing file extensions.

3
Extract the ZIP contents

Right-click the newly created .zip file and select 'Extract All' using Windows Explorer, or use a preferred archiving tool to unzip the contents.

4
Locate the extracted images

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.

Extract Images by Renaming the Document to ZIP
Fast Bulk Extraction: This method guarantees that all graphics are exported at their original resolution without any compression applied by manual saving.
Efficient Document Management

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. 1. Open your document: Launch WPS Writer and open the .docx file containing the images.
  2. 2. Select the target image: Scroll to the graphic you want to extract and click on it to highlight the image.
  3. 3. Trigger the save command: Right-click the highlighted image and select 'Save as Picture' from the context menu.
  4. 4. Choose format and save: Select PNG from the file format dropdown, choose a destination on your device, and click 'Save'.
Free and lightweight alternative to Microsoft OfficeFully compatible with Microsoft Word (.docx) formats and objectsUser-friendly interface for effortless document editing and individual image extraction
microsoft office alternative - wps office

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.