
Word: Macros to delete all tables and figures
June 23, 2011I have NO idea why you might want to do this, but figured I’d share these two macros — one is to delete all tables, and the other is to delete all figures from a Word document.
The macro to delete all tables is from Allen Wyatt’s Word VBA Guidebook (http://store.tips.net/T010353_Word_VBA_Guidebook_Table_of_Contents.html); the one to delete all figures was one I created based on the tables one. However, it wasn’t easy! Unlike tables (Table object), figures aren’t under normal words like ‘figure’, ‘picture’, ‘photo’, ‘diagram’, or ‘image’ — no, they are part of the InlineShape object! That bit of information took some time to find.
Please use with caution — these macros WILL delete every table or figure, except those in your document’s headers and footers.
Macro to delete all tables in a document
Sub TablesDeleteAll()
Dim tbl As Table
For Each tbl In ActiveDocument.Tables
tbl.Delete
Next tbl
End Sub
Macro to delete all figures in a document
Sub FiguresDeleteAll()
Dim fig As InlineShape
For Each fig In ActiveDocument.InlineShapes
fig.Delete
Next fig
End Sub
[Links last checked June 2011]
![]() |
Has this tip helped you? saved you time? saved your skin? You can thank me by clicking on the cup and buying me a coffee. (An E-Junkie shopping cart page will open where you can pay for my coffee via PayPal.) |




Delete all tables is exactly what I wanted!!!! Thanks!