Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

Parse XML data to bring into Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DavidF - 02 Mar 2007 04:23 GMT
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.

Signature

df

Jezebel - 02 Mar 2007 05:52 GMT
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.

> All I need to do is parse data and copy it into variables.
>
[quoted text clipped - 6 lines]
> Any help about where to start would be appreciated.
> I did set a reference to MSXML, but still get errors.
DavidF - 02 Mar 2007 06:48 GMT
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,

Signature

df

> 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
[quoted text clipped - 19 lines]
>> Any help about where to start would be appreciated.
>> I did set a reference to MSXML, but still get errors.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.