Remove tables

J

Jeff

I have converted some HTML to word but many of the pictures and text
are in tables. I would like to remove the tables but keep the content
is there a way to do that in VBA

TIA
 
J

Jay Freedman

I have converted some HTML to word but many of the pictures and text
are in tables. I would like to remove the tables but keep the content
is there a way to do that in VBA

TIA

Yes, the Table object has a ConvertToText method.

If you want to convert all the tables in the document to plain text, use this:

Sub demo()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
oTbl.ConvertToText
Next
End Sub

If you want to keep some of the tables, you'll have to figure out how to tell
the macro which ones to convert and which to leave.
 
Top