Accessing XML file from Word

J

jockster

Hi All

I am doing a project where I need to be able to associate keywords with
each paragraph I have in various Word documents. The keywords are
stored externally in an XML file.

I want document authors to be able to choose key words from the XML
file from within Word by running a Macro at the end of each paragraph.
This Macro should interogate the XML file and present the keywords to
select as a menu, with the nested nature of the keyword structure
presented as menus and sub-menu's.

I would be very grateful if someone could advise me if this is easily
possible and point me in the right direction as to where to start.

Thanks for any help given, Simon
 
J

Jonathan West

Hi jockster

The simplest thing to do is set a Reference in your project to a version of
the Microsoft XML document object library. If you open an XML file using
that, all the nodes are nicely mapped into objects and collections, so you
don't have to parse the XML file yourself.

The following link gives you a tutorial on using the Microsoft XML library

http://www.w3schools.com/xml/xml_parser.asp

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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