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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top