WordProcessingML from a document

N

nitm

hi,

i want to get the xml (WordProcessingML) out of an existing word (2003)
document.
i searched and asked over the net and came across this:
ActiveDocument.Content.XML
but for some reason i don't have it.. maybe it's available only on word 2007?
what i do have is:
ActiveDocument.Content.XMLNodes
and
ActiveDocument.Content.XMLParentNode
but the first gives me an empty list and the second yields a weird exception
from the COM object.

so, how do i get the xml of the document?
thanks a lot, nitzan
 
B

Bob Eaton

Try

ActiveDocument.Content.get_XML(false); // or 'true' to get just the data

I think this is screwy because it's a "property" that takes a parameter
(i.e. bool DataOnly), whereas most parameters don't... but that's just a
guess.

The other two, XMLNodes and XMLParentNode, are only valid, "In documents
created with a schema" (see
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.OFFADD.v10.en/odc_wd2003_ta/html/odc_Wdnew2k3XMLOM.htm)

Bob
 
B

Bob Eaton

Try

ActiveDocument.Content.get_XML(false); // or 'true' to get just the data

I think this is screwy because it's a "property" that takes a parameter
(i.e. bool DataOnly), whereas most parameters don't... but that's just a
guess.

The other two, XMLNodes and XMLParentNode, are only valid, "In documents
created with a schema" (see
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.OFFADD.v10.en/odc_wd2003_ta/html/odc_Wdnew2k3XMLOM.htm)

Bob
 

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