Parse XML data to bring into Word

D

DavidF

All I need to do is parse data and copy it into variables.

We are moving data from a custom C# ap into Word, using XML copied to the
clipboard. I'm working on the VBA code, not the C# ap. Having a hard time
getting started. I found this
http://msdn2.microsoft.com/en-us/library/aa163921(office.10).aspx
Unfortunately, the code doesn't work in Word 2007. Typos it seems. :(

Any help about where to start would be appreciated.
I did set a reference to MSXML, but still get errors.
 
J

Jezebel

Bit hard to diagnose, since you don't say what's actually going wrong or
what errors you get. MSXML certainly works in general. But you're also right
about the typos in the MS example. It seems to have lost many of (but not
all) of its spaces. Lines like

ForEachoCountry InoRoot.childNodes

should obviously be

For Each oCountry In oRoot.childNodes

etc.
 
D

DavidF

Found the main problem:
This won't compile:
Dim oTest As MSXML.DOMDocument

This will compile:
Dim oTest As MSXML2.DOMDocument

Using later versions of MSXML cause this problem.
Stumbled onto it searching the internet.

Thanks,
 

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