Document Properties missing from document xml

V

Vincent Croft

I want to programatically retrieve a WordProcessingML version an entire
document using automation without having to save it to disk.

I am currently getting the entire document as a Range and using the XML
function or more precisely the get_XML() interop function.

This works find except that I have just noticed that some nodes in the WPML
are missing (compared with the saved file.) In particular, the document
properties and custom properties are missing.

I can see that it may be appropriate to not provide complete document
information from a function that potentially only deals with a section of the
document (though most of the other document overhead is returned.) But... how
do I get a complete version of the document xml without having to write it to
disk (not appropriate in this case.) I can't see anything but have missed
things before so any help would be much appreciated.
 
W

Word Heretic

G'day "Vincent Croft said:
I am currently getting the entire document as a Range and using the XML
function or more precisely the get_XML() interop function.

Therein lies your problem. A range is not a document, thus has no
document properties. You can use the Parent of the range to get to teh
original document, or you could pass the document as a document and
work on its components directly.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Vincent Croft reckoned:
 
V

Vincent Croft

Thanks for replying Steve,

I need to serialize the 'complete' document as WordProcessingML. I have not
found any methods or properties on the document object that allow me to do
this (without creating a file first.) The get_XML() function on the
Range/Selection interfaces is the only method that I am aware of to retrieve
a WPML version of document contents.

Let me know if you are aware of any other method.

Thanks,
Vincent Croft.
 
W

Word Heretic

G'day "Vincent Croft" <[email protected]>,

Heh - the nastiest way - which I prefer coz it guarentees MS's crazy
ideas about what i am trying to do don't get in the damn road - is to
open an xml document as text. The bummer is writing XML handler code
yourself :)

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Vincent Croft reckoned:
 

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