NESTING - DOES ANYBODY KNOW??

P

Pat Garard

G'Day All,

Is there a smart way to locate, within a long document, tables
and/or text boxes that happen to be 'nested'?

I am trying to create an MSReader eBook, and it falls over
because of nested tables or text boxes.
--
Regards,
Pat Garard
Australia

______________________________________
 
J

Jezebel

Iterate the tables of the document; in each case check the .NestingLevel
property: if that is > 1 the table is nested.
 
P

Pat Garard

Ah.... Jezebel,

Thank you! - Any ideas on Text Boxes?
--
Regards,
Pat Garard
Australia

______________________________________
 
J

Jezebel

Thank you! - Any ideas on Text Boxes?
--

Pat, this question is a tad cryptic. I have lots of ideas on Text Boxes;
most of them obscure, unprintable, and of extremely dubious relevance ...

Textboxes can't be nested (in W2000, anyway). They may overlap -- so that
graphically they have the appearance of nesting -- but the range to which a
textbox is anchored must be part of the MainStory or a Header/Footer. You
can't anchor a textbox to a paragraph within a textbox.
 
P

Pat Garard

Wow Jezebel!

I can nest a Table OR a Text Box into a Table.
I can nest a Table into a Text Box (but that
table may not then contain another Text Box).

I need to be able to detect all such nestings.
--
Regards,
Pat Garard
Australia

______________________________________
 
J

Jezebel

You need to make a distinction between nesting and anchoring. I don't know
the detailed answer to this -- you'll need to do some experimenting, I
guess.

You can work out where textboxes are anchored by looking at the shape's
Anchor property -- this is a reference to the range (ie paragraph) to which
the shape is attached -- you can then check that Range's Information()
property to work out if you are anchored to a paragraph within a table.

Not sure what's the most efficient way to pick if a table is within a
textbox. For one thing, tables in textboxes are not members of the
ActiveDocument.Tables collection, so simply iterating the tables collection
won't encounter them anyway. To find tables within textboxes you could
iterate the activedocument.StoryRanges(wdTextFrameStory).Tables collection.
Does that help?

Perhaps for your purpose, dealing with the distinct StoryRanges as separate
entities might be the best approach.
 
P

Pat Garard

G'Day All,

The product I am using is OverDrive ReaderWorks.

Their support now tell me that the 'unusual' nesting is
sometimes carried out by Word during a 'Save As...'
to HTML format.

This means that the 'nesting' is often NOT found in
the DOC format........

(to be continued..........(maybe).)
--
Regards,
Pat Garard
Australia

______________________________________
 
P

Pat Garard

Thanks 'bel!
--
Regards,
Pat Garard
Australia

______________________________________
 
J

Jezebel

They might be right at that. Word's table machinery got MUCH more complex
with W2000, precisely to deal with the issue of HTML tables which are
conceptually rather different from Word tables. As you might have discovered
already, Word tables get rather hairy (for automated processing) if you have
merged and split cells. HTML tables handle this in a completely different
way.

Creating a nested table is an reasonable work-around for some purposes: if
your table has one cell split into two columns, then in HTML all the *other*
rows have to take that into account when dealing with the corresponding cell
in that column (COLSPAN=2). This gets horribly messy if other rows have
splits and merges in other columns. The simpler alternative is to leave the
cell unsplit but to nest another table (one row, two columns) within it.

You can check the Table's Uniform property to see whether the table has any
such 'features'.
 
P

Pat Garard

Jezebel - Yer Blood's Worth Bottlin',

I will look for split/merged cells in the original DOC.

Why you waste your time with George Bush's faeces - or
at least cleaning out the nose of his Pet Goat - I'll never know.

Many Thanks!
--
Regards,
Pat Garard
Australia

______________________________________
 

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