XML Which version of word is needed

M

Mark Baird

Do you need to merge XML data into a Word document?

You can use any of the Microsoft XML parsers in any Office
application.

Office 2003 allows you to embed custom XML tags in the
file format itself. Office 2003 also installs the next
version of the XML parser. There are also new XML methods
and properties in Office 2003 but these methods do not
allow you to open an external XML file for merging into
Word.

With Office 2003 you can also insert an XPath expression
into the INCLUDETEXT field to import data from a external
XML file.


Mark Baird
-----Original Message-----
Hi

I see a lot ove XML issued solved using Word 2003. Is it
possible to work with XML data in Word 2000 (or XP)?, or
mus I do an upgrade before I can write stuff like
xmlDoc.Load("....").
 
P

Peter

SteveP said:
I have a word 2002 macro button that currently lets the user pick an xml file
from their pc and what I want to do is read the xml file they select and
remove a specific node from the xml file and save it.

How do I code the xml parser in the macro?

Does anyone have some sample code that I can paste into a word macro that
finds and opens an XML so I can remove a node from the file?

I believe you need to add a reference to an XML parser to your project (Tools -> References...), then use that parser to read the file.
You can download Microsoft's XML parser at http://msdn.microsoft.com/XML/XMLDownloads/default.aspx.
Once it's installed, it'll be listed in the references as Microsoft XML, V<version #>.

Here's a simplistic example of how to use the MSXML parser, V4.0:

Function getNode(XMLfilename As String, nodeName As String)
Dim xmlObj As MSXML2.DOMDocument40
Set xmlObj = New MSXML2.DOMDocument40
Call xmlObj.Load(XMLfilename)
getNode = xmlObj.selectSingleNode("//" & nodeName).Text
End Function

hth,

-Peter
 

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