I am trying to access xml elements in a word 2003 document (ActiveDocument) in VBA. I have discovered the XMLNodes collection of the ActiveDocument, but was disappointed to discover that elements of the collection can be referrenced by ordinal index number only! I am wondering if anyone might know of a way to directly access an element by its name, instead.
Here is the code that allows me to do it with ordinal index numbers:
ActiveDocument.XMLNodes(1).ChildNodes(1).Text
I've tried this, which doesn't work:
ActiveDocument.XMLNodes(1).ChildNodes("MyNode").Text
Thanks!
Here is the code that allows me to do it with ordinal index numbers:
ActiveDocument.XMLNodes(1).ChildNodes(1).Text
I've tried this, which doesn't work:
ActiveDocument.XMLNodes(1).ChildNodes("MyNode").Text
Thanks!