> Morning everyone,
>
[quoted text clipped - 17 lines]
> exampls of a SQL query syntax for the merge datasource but
> can't get this to work.
The versio of Word is relevant here as
a. Word 2002/2003 tends to try to use an OLEDB provider as the default
way to get data, and you will probably run into problems with most of
those when you have large numbers of fields
b. Word 2000 will typically try to use either an internal text
converter or ODBC, and you will run into problems with ODBC on column
count, and the text converter if you have non-ASCII characters
If you are using Word 2002/2003, try:
a. giving your csv file a .txt extension
b. checking Word Tools|Options|General|COnfirm conversions on open
c. go through the connection process and select the Text files (*.txt)
open. If you have to name the file .csv, you will need to check the
"Show all" box to see the Text files option.
However, I have used quite simple test files to check this - more
complexity (such as quotes round fields, commas in the data etc. may
create problems).
In VBA, you /may/ be able to achieve the same thing by setting Name to
the file path name in OpenDataSource, setting Connection, SQLStatement
to "", and using
Subtype:=wdMergeSubtypeOther
but you will need to test that too.
You may have more difficulty if you have non-ASCII data and have to use
a Unicode-encoded text file - in that case you wil lprobably see the
encoding dialog box, and I don't think you wil be able to avoid that in
code. Probably your best bet in that case would be to open the file
programmatically, specifying the encoding (which you can do in a
Document Open, but not in OpenDataSource) and save it as a
comma-delimited Word (.doc) file, then use that as the data source.
Peter Jamieson
Thanks for that Peter,
I did make some progress, in that I can now use either CSV
or TXT file extensions.
A problem I had with a dialog box asking for field &
record delimiters was because of using the wrong character
for the Newline / vbCr
Also the problem about the datasource not being valid was
due to one extra value compared to field header (basically
a comma to many in line 2)
Now have working datasource with 684 fields
Thanks
Keith
>-----Original Message-----
>> Morning everyone,
[quoted text clipped - 54 lines]
>Peter Jamieson
>.