Are there limits to Nesting? Here's one...

T

TimvG

What limits are there to nesting tables in Word? And what problems
are encountered as you nest deeply?

I'm developing an "application" that involves lots of tables within
tables within tables within.... In general I'm really impressed with
how well Word handles deeply nested table structures. Of course,
performance does suffer as nesting gets deeper. But I haven't found
any "hard" limit to how many levels of nesting you can have.

One problem I *have* encountered is this: apparently, you can't set
the font as hidden/unhidden when there are ten or more nested tables.
To explain: In my application, it is often useful to hide the
"children" (nested tables) of a table. A very handy trick for doing
this is to simply set the font of the nested tables to hidden; e.g.:

Selection.Cells(1).Tables(1).Range.Font.Hidden = True

However, if you try this when Tables(1) itself contains 9 or more
tables, then you get an error. If you ask Word to tell you the
"hidden" status of the topmost nested table

msgbox Selection.Cells(1).Tables(1).Range.Font.Hidden it returns
"9999999" - i.e. apparently it just can't calculate the status.

I'm interested whether anyone else

(a) has encountered the same problem, or perhaps has a fix/workaround

(b) more generally, knows of any other limits to nesting, or problems
you encounter when doing lots of nesting.
 
S

Suzanne S. Barnhill

There seems to be a limit of nine on other things: outline numbering levels,
MRU list (Word 2003 and earlier), files on the Work menu. This suggests some
built-in limitation of the code.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 

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