Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Andrew Kennard[_2_] Andrew Kennard[_2_] is offline
external usenet poster
 
Posts: 19
Default Word2003 XML as data source ?

Hi

I'm trying to use an XML file as a data source for mailmerging in Word 2003

However When I try and open it via the datasources button it does not open
it and asks me what is it delimited by !

Ultimately I want to automate this via COM from another application and have
done this so far using CSV files which works fine

When I use the OpenDataSource method I am passing wdOpenFormatText to it

As there is a wdOpenFormatXML I assumed I could use an XML file ?

However as I cant seem to get this to work 'manually' as a user ?

What am I missing ?

I need to use XML files to get over quote and comma problems. I also have a
large description field I wish to use. I had considered automating excel and
saving the data in an excel file and linking it to that but it has a 32k
cell limit size which is too small

Thanks

Andrew





  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word2003 XML as data source ?

Unfortunately you can't use XML format data directly as a data source.
Believe me, I tried to get MS to support it several years ago, for exactly
the reason you quote.

Since the Excel approach isn't going to work, the only things I can suggest
are to
a. transform into an HTML table. The XSLT for that should be fairly
straightforward, but off the top of my head I cannot remember whether Word
imposes the same column count limit (around 63) as it does on its own
tables. Also, I do not know whether Word will accept the kind of text
volumes you mention using that format.
b. transform into a Word document containing a table in WordProcessingML
(i.e. Word 2003 WordProcessingML format). Harder, same limit on column
count, but it is more likely to work. If you are unfamiliar with
WordProcessingML then the first problem is to find out what XML you need to
output. The only way to do that IME is to create a Word table, save it as
XML, and start discarding stuff like font/style info. until you can no
longer open the .xml in Word. (I may have a good starting point for this but
it's a long time ago and would take some digging out. Before doing any of
that, I'd just check that you can use document in WordProcessingML format as
a data source.
c. (maybe) use ADO/ADOX to convert the data into .mdb format

As there is a wdOpenFormatXML I assumed I could use an XML file ?


This is really for opening WordProcessingML documents I think.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Andrew Kennard" wrote in message
...
Hi

I'm trying to use an XML file as a data source for mailmerging in Word
2003

However When I try and open it via the datasources button it does not open
it and asks me what is it delimited by !

Ultimately I want to automate this via COM from another application and
have done this so far using CSV files which works fine

When I use the OpenDataSource method I am passing wdOpenFormatText to
it

As there is a wdOpenFormatXML I assumed I could use an XML file ?

However as I cant seem to get this to work 'manually' as a user ?

What am I missing ?

I need to use XML files to get over quote and comma problems. I also have
a large description field I wish to use. I had considered automating excel
and saving the data in an excel file and linking it to that but it has a
32k cell limit size which is too small

Thanks

Andrew






  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Andrew Kennard[_2_] Andrew Kennard[_2_] is offline
external usenet poster
 
Posts: 19
Default Word2003 XML as data source ?

Peter

Thanks very much for your reply

Looks like I'll have to get my thinking cap on !

Cheers

Andrew

"Peter Jamieson" wrote in message
...
Unfortunately you can't use XML format data directly as a data source.
Believe me, I tried to get MS to support it several years ago, for exactly
the reason you quote.

Since the Excel approach isn't going to work, the only things I can
suggest are to
a. transform into an HTML table. The XSLT for that should be fairly
straightforward, but off the top of my head I cannot remember whether Word
imposes the same column count limit (around 63) as it does on its own
tables. Also, I do not know whether Word will accept the kind of text
volumes you mention using that format.
b. transform into a Word document containing a table in WordProcessingML
(i.e. Word 2003 WordProcessingML format). Harder, same limit on column
count, but it is more likely to work. If you are unfamiliar with
WordProcessingML then the first problem is to find out what XML you need
to output. The only way to do that IME is to create a Word table, save it
as XML, and start discarding stuff like font/style info. until you can no
longer open the .xml in Word. (I may have a good starting point for this
but it's a long time ago and would take some digging out. Before doing any
of that, I'd just check that you can use document in WordProcessingML
format as a data source.
c. (maybe) use ADO/ADOX to convert the data into .mdb format

As there is a wdOpenFormatXML I assumed I could use an XML file ?


This is really for opening WordProcessingML documents I think.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Andrew Kennard" wrote in message
...
Hi

I'm trying to use an XML file as a data source for mailmerging in Word
2003

However When I try and open it via the datasources button it does not
open it and asks me what is it delimited by !

Ultimately I want to automate this via COM from another application and
have done this so far using CSV files which works fine

When I use the OpenDataSource method I am passing wdOpenFormatText to
it

As there is a wdOpenFormatXML I assumed I could use an XML file ?

However as I cant seem to get this to work 'manually' as a user ?

What am I missing ?

I need to use XML files to get over quote and comma problems. I also have
a large description field I wish to use. I had considered automating
excel and saving the data in an excel file and linking it to that but it
has a 32k cell limit size which is too small

Thanks

Andrew








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
How to link a different Mailmerge header source and data source? Eleni_Malli Mailmerge 1 May 3rd 06 02:08 PM
How can I add data fields to a data source in Word Mail Merge? cd Mailmerge 2 November 7th 05 07:41 PM
data form button greyed out in word 97 data source Busylady Mailmerge 0 September 15th 05 10:00 PM
DotNet Data Table as Mail Merge Data Source goraya Mailmerge 1 July 7th 05 09:51 AM
data in mail merge letter being cut off - data source field size? tgone Mailmerge 1 May 20th 05 02:10 PM


All times are GMT +1. The time now is 01:29 AM.

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

About Us

"It's about Microsoft Word"