Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Jalz Jalz is offline
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail-Merge: Can we have master detail relationship or multiple entities in word Mail-Merge? gmax2006 Microsoft Word Help 1 March 28th 07 06:28 PM
Take Mail Merge in Word back the the Mail Merge Helper 1,2,3 Form. Chris Green Mailmerge 5 October 8th 05 03:51 PM
collate pages in mail merge vs mail merge being single document Dan Schwab Mailmerge 2 September 14th 05 09:35 PM
Proteced Form with Mail Merge Section-Mail Merge is "lost" whe F. Ferrer Microsoft Word Help 0 February 2nd 05 08:27 PM
mail merge doc with further linked/embedded mail merge docs not playing the game Rob Cowlard Mailmerge 3 January 8th 05 09:15 AM


All times are GMT +1. The time now is 02:31 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"