Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word Mail Merge with xml
Hello All,
Im interested in getting data out of one of our databases using XML/XSLT into word. Does anyone know if it is possible to do this with word, and how I can achieve this. I can't use odbc as the odbc seems very unstable with my db. Any help/hints tips would be great. Kindest regards |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word Mail Merge with xml
Out of the box, Word cannot use XML format data directly as a merge data
source, so the main issues become: a. is there anything that you can easily transform your data into using XSLT or otherwise and b. does that have any benefit over other possible formats such as tab-delimited If you have over 255 columns, the only format that is supported "out of the box" is basically "delimited text file", which either means a plain text file or delimited text in another format Word can read natively such as .doc (i.e. a Word document with one delimited text file row per record) or .rtf. You may also be able to use .htm, which is probably the simplest option if you can easily transform your XML via XSLT. Then you have to consider what to do with characters in the data that are used as delimiters in the delimited text file - in essence, you have to - surround each field using double-quotes - double up double-quotes in the data - etc. If you have 255 colums or fewer, you could consider trying to open simple XML files in Excel, save as .xls(x), then use that as the data source (by simple I mean an XML file that "emulates" a .csv type file, i.e. a file with a simple structure like row element1data/element1 ... elementndata/elementn /row where every row has the same child elements) If you have around 64 coulumns or fewer (whatever the maximum Word can store in a table) then the simplest approach is probably to transform your XML into a simple HTML document containing a single table with one row per record. Word can use those as data sources. If you are using Word 2003 or later, you can also consider using XSLT to transform your data into WordProcessingML format, either aiming for delimited format text (65 columns of data or more) or a Word table (64 columns or fewer). But it would be harder. If your data uses characters outside the supported character set on your system (e.g. if it uses Unicode extensively) then there is a secondary issue as to which of the formats can preserve those characters and get them through to mail merge. If you are using Word 2007 this might be a good time to consider using the merge approach that uses VBA/.NET code, content controls and a custom data store to generate multiple copies of your document. But that's really another story. Sorry the picture is not rosier! I can't use odbc as the odbc seems very unstable with my db. What db is it? (Curiosity, mainly!) -- Peter Jamieson http://tips.pjmsn.me.uk "Jalz" wrote in message ... Hello All, Im interested in getting data out of one of our databases using XML/XSLT into word. Does anyone know if it is possible to do this with word, and how I can achieve this. I can't use odbc as the odbc seems very unstable with my db. Any help/hints tips would be great. Kindest regards |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word Mail Merge with xml
See the "Retrieving Information from an XML Document" section
of the article at http://msdn.microsoft.com/en-us/library/aa468547.aspx -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Jalz" wrote in message ... Hello All, Im interested in getting data out of one of our databases using XML/XSLT into word. Does anyone know if it is possible to do this with word, and how I can achieve this. I can't use odbc as the odbc seems very unstable with my db. Any help/hints tips would be great. Kindest regards |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mail-Merge: Can we have master detail relationship or multiple entities in word Mail-Merge? | Microsoft Word Help | |||
Take Mail Merge in Word back the the Mail Merge Helper 1,2,3 Form. | Mailmerge | |||
collate pages in mail merge vs mail merge being single document | Mailmerge | |||
Proteced Form with Mail Merge Section-Mail Merge is "lost" whe | Microsoft Word Help | |||
mail merge doc with further linked/embedded mail merge docs not playing the game | Mailmerge |