Microsoft Word – Use a VBA Macro to Delete All Images
- Posted by
- Posted on January 28, 2025
- IT Support
- No Comments.
You can use a VBA macro to find and delete all pictures in a Microsoft Word document.
Before starting, make sure macros are allowed in your document.
If they are not, save the file as a “.docm” Word document to allow macros to run.
1.) Press Alt + F11 to open the Visual Basic for Applications (VBA) editor.

2.) Click on Insert and select Module to insert a new module.

3.) Copy and paste the following VBA code into the module:
Sub DeleteAllPictures() Dim shp As Shape Dim inShp As InlineShape ' Delete Shape objects For Each shp In ActiveDocument.Shapes If shp.Type = msoPicture Then shp.Delete Next shp ' Delete InlineShape objects For Each inShp In ActiveDocument.InlineShapes If inShp.Type = wdInlineShapePicture Or inShp.Type = wdInlineShapeLinkedPicture Then inShp.Delete End If Next inShp End Sub

4.) Either click on the green “Run” button..
Or go to the menu, select Run, and then click on “Run Sub/UserForm” from the drop-down menu.

Post Tagged with delete all pictures, delete pictures, macro, macro that deletes images, macro that deletes pictures, Microsoft Word, module, vba, vba macro, vba module, Word
Recent Posts
- Rack Cabling, Labeling, and Rack Design Standards
- Run the Printer Installation UI as Administrator in Windows
- Change the Maximum Size Limit for Outlook PST and OST Files
- So You Want to Be a Hacker, Eh?
- New Chrome Setting Which Blocks Local Network Access for Web Apps
Archives
- May 2026
- February 2026
- January 2026
- December 2025
- October 2025
- September 2025
- August 2025
- July 2025
- June 2025
- February 2025
- January 2025
- July 2022
- February 2022
- January 2021
- July 2020
- May 2020
- February 2020
- December 2019
- August 2019
- January 2019
- July 2018
Categories
- Audio / Video
- Computers
- Hacking
- IT Support
- Lab
- Linux
- Mac OS
- Management
- Microsoft Applications
- Networking
- Printer
- Router
- Servers
- Switch
- Uncategorised
- Video Conferencing
- Virtualization
- Website
- Windows
