Or...should I be looking at the Word Document Model in a more generic
fashion? If the list below shows a generic model for a document, how
should I access all the other object such as shapes. lists, tables, etc
to dump them in the correct order?


Document
Sections
Section
Headers
Header
Paragraphs
Paragraph
Sentences
Sentence
Words
Word
Footers
Footer

---------------------------------
Trevor Lowing
Satellite Beach, Fl

tlowing@-removenospam-lowing.org
---------------------------------
Need help with:
Access?
http://www.mvps.org/access/
Outlook?
http://www.slipstick.com/
Visio?
http://www.mvps.org/visio/
HTML/CSS?
http://www.NCDesign.org
Scripting(VBScript/JScript/WSH/XML)?
http://www.DevGuru.com
http://cwashington.netreach.net/
http://developer.irt.org/script/script.htm
---------------------------------

Re: Recurse Word Object Model Redux by Klaus

Klaus
Wed Mar 16 14:32:21 CST 2005

Hi Trevor,

Some remarks:

-- I'd look at how StoryRanges figure into this.

-- Whether you treat paragraphs as parts of the doc (as in your first =
list) or as part of sections (your second list) is a matter of choice, =
depending on what you want to do. In the VBA help, you can see =
Paragraphs can be accessed from the Document, Selection, or some Range. =
If you want to create some hierarchy for accessing all objects in a doc, =
the "natural" parent would, IMO, be the StoryRange (as a special case of =
a Range).

-- Shapes and floating tables will probably be problematic if you want =
to traverse a document, "collecting" all objects.
Best consult the VBA help on where they may appear (say, Shapes as part =
of other Shapes, ShapeRanges, ...).=20

-- I wouldn't deal with Words and Sentences if it can be avoided. Both =
are calculated on the fly, and that takes a lot of time that's usually =
wasted, because few macros need to deal with text on that level.

HTH,
Klaus




"Trevor Lowing" <tlowing@earthlink.net> wrote:
> Or...should I be looking at the Word Document Model in a more generic=20
> fashion? If the list below shows a generic model for a document, how=20
> should I access all the other object such as shapes. lists, tables, =
etc=20
> to dump them in the correct order?
>=20
>=20
> Document
> Sections
> Section
> Headers
> Header
> Paragraphs
> Paragraph
> Sentences
> Sentence
> Words
> Word
> Footers
> Footer
>=20
> ---------------------------------
> Trevor Lowing
> Satellite Beach, Fl
>=20
> tlowing@-removenospam-lowing.org
> ---------------------------------
> Need help with:
> Access?
> http://www.mvps.org/access/
> Outlook?
> http://www.slipstick.com/
> Visio?
> http://www.mvps.org/visio/
> HTML/CSS?
> http://www.NCDesign.org
> Scripting(VBScript/JScript/WSH/XML)?
> http://www.DevGuru.com
> http://cwashington.netreach.net/
> http://developer.irt.org/script/script.htm
> ---------------------------------