View Single Post
  #4   Report Post  
Posted to microsoft.public.word.tables
Jezebel
 
Posts: n/a
Default find a table within a document

Ah. The question would have been better posted to the VBA forum. No matter.

From VBA you iterate the Tables collection ---

Dim pTable as Word.Table

For each pTable in ActiveDocument.Tables
...
Next

You can use pTables.Columns.Count to check the number of columns; but be
aware that this property may be unavailable if the table is not uniform --
if it contains merged or split cells.





"MichaelB" wrote in message
...
Jezebel,

Thanks for the response, I truly appreciate the help.

Please excuse my lack of information but I am looking for the VBA way to
perform this search. I need to find a way to search for all the tables
within
the document with four/five columns defined so I can then implement
alterations to the table layout.

Thanks again..
Mike


"Jezebel" wrote:

Set 'table' as your browse object by clicking the little circle between
the
double up/down arrows at the base of the vertical scroll bar. Then click
the
double down arrow until you get to a table with four or five columns. (At
least I assume that's what you mean by "4" and "5" -- or is there hidden
significance here?)

There's no way to use Find to look for tables as such.

There are VBA methods, but doesn't sound like you need that.





"MichaelB" wrote in message
...
I am trying to figure out how to find specific tables within a document.
I
have several tables within some rather large document that need to be
modified to a new format. I'm having trouble identifying how to create
the
search for tables that have either "4" columns or "5" columns within.
Once
I
find these tables I then need to modify the column widths as well as
some
other basic configuration (test wrapping, vertical alignment, etc). If
someone could help me out with the search criteria I'm sure I can put
the
rest together.

Any help would be greatly appreciated.
Thanks
Mike