View Single Post
  #2   Report Post  
Posted to microsoft.public.word.tables
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Selecting Nested Tables

On Wed, 27 Aug 2008 05:20:02 -0700, RPMitchal
wrote:

Word 2003

My apologies if I have duplicated this posting. I seem to be having
problems with getting it posted.

In the case of nested tables, is there a process by which one can select a
nested table for modification, separation and/or deletion?

Much thanks in advance - Rod


Assuming you know or can determine which cell of the outer table contains a
nested table, you can do something like this:

ActiveDocument.Tables(1).Cell(1,1).Tables(1).Selec t

It selects the nested table in the top left cell of the outer table. If that
second-level table contains a third-level nested table in the top cell of the
second column, you can get that one by

ActiveDocument.Tables(1).Cell(1,1).Tables(1).Cell( 1,2).Tables(1).Select

Also, remember that it often isn't necessary to select something in order to do
something with it. For example, if you want to delete the nested table, don't
select it; just do

ActiveDocument.Tables(1).Cell(1,1).Tables(1).Delet e

If you need to determine how deeply nested a particular table is, you can look
at its .NestingLevel property. Look it up in the Help.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.