Customizing Word 2003 for XML editing

J

Justin

I am attempting to make a change to Word to make it a better XML editor and I
haven't been able to find the information that I need. Currently when a
schema is provided to word it pays no attention to the minimum and maximum
number of occurences for any element. What I would like to do is when an
element has been added to the XML if it has reached the maximum numbers of
occurences then I want to remove it from the child nodes list because adding
another will cause the file to be invalid according to the schema. The list I
am referring to is in the lower left corner of Word and it is part of the XML
structure pane. I believe an XML document must be open with an attached
schema for this list to be seen. I think I can gain access to the list using
the XMLChildNodeSuggestion object in VBA but this still leaves me with one
problem. I'm not sure how to figure out the min and max occurences. This is
my question , does anyone know how to use VBA or something else to access the
schema information so that I can remove elements from the list once they are
placed in the document the maximum number of times. I can think of atleast
one way to get around this but it would be quite ugly and possibly very slow.
Thank you in advance for any suggestions.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SnVzdGlu?=,

You should probably ask this in the XML newsgroup. Phrase it such to ask if/how
you can use MSXML (that's a library to work with XML programatically) to access
a schema and get the max and min attributes for a particular element.
I am attempting to make a change to Word to make it a better XML editor and I
haven't been able to find the information that I need. Currently when a
schema is provided to word it pays no attention to the minimum and maximum
number of occurences for any element. What I would like to do is when an
element has been added to the XML if it has reached the maximum numbers of
occurences then I want to remove it from the child nodes list because adding
another will cause the file to be invalid according to the schema. The list I
am referring to is in the lower left corner of Word and it is part of the XML
structure pane. I believe an XML document must be open with an attached
schema for this list to be seen. I think I can gain access to the list using
the XMLChildNodeSuggestion object in VBA but this still leaves me with one
problem. I'm not sure how to figure out the min and max occurences. This is
my question , does anyone know how to use VBA or something else to access the
schema information so that I can remove elements from the list once they are
placed in the document the maximum number of times. I can think of atleast
one way to get around this but it would be quite ugly and possibly very slow.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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