Making a table "hidden text"

S

Shubha

I want to make a table and the content hidden. When I do so, it seems to
work in that if I have the show hidden text option off, the table is no
longer visible and the text before and after the table do get closer
together. However if I do a replace on all hidden text to delete it, the
content in the table gets deleted, but the table remains. I end up with a
blank table. How can I either make the table hidden as well, or delete *all*
the tables in my document at once?
 
C

Charles Kenyon

The following macro will delete all tables in the body of a document; it
won't reach those in headers or footers.

Sub AllTablesDelete()
' Written 2005 June 10 by Charles Kenyon
' Deletes all tables in the body of a document
'
Dim oTable As Table
For Each oTable In ActiveDocument.Tables
oTable.Delete
Next oTable
End Sub

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
K

Klaus Linke

And if you only want to delete hidden tables:

Dim oTable As Table
For Each oTable In ActiveDocument.Tables
If oTable.Range.Font.Hidden Then
oTable.Delete
End If
Next oTable

Regards,
Klaus
 

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