Find / delete tables

M

Mat

I want to search a document and delete any tables found.
I cant see how to select a 'table' in VBA. This should
loop and search through whole document. Any help would be
really appreciated. Thanks.
 
A

Anne Troy

Hi, Mat. Try recording a macro that does Edit-Go to-Table...
<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*->
Hope this helps!
Anne Troy (better known as Dreamboat)
Author: Dreamboat on Word
Email: Dreamboat*at*Piersontech.com
Web: www.TheOfficeExperts.com
<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*->
 
C

Cindy M -WordMVP-

Hi Mat,
I want to search a document and delete any tables found.
I cant see how to select a 'table' in VBA. This should
loop and search through whole document.
Try this:

For Each tbl in ActiveDocument.Tables
tbl.Delete
Next tbl

It's much better to work with the object model whenever
possible, rather than selecting and manipulating things the
way users do. Users can see what they're doing, the macro
can't :)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

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