Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Recurse Word Object Model Redux

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Trevor Lowing - 13 Mar 2005 16:56 GMT
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
---------------------------------
Klaus Linke - 16 Mar 2005 21:32 GMT
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, ...).

-- 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

> 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
[quoted text clipped - 35 lines]
>          http://developer.irt.org/script/script.htm
> ---------------------------------
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.