View Single Post
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
[email protected] martin.craig1@googlemail.com is offline
external usenet poster
 
Posts: 3
Default CSV file as source for DATABASE field

I'm trying to use a CSV file and a DATABASE field to programatically
insert a table into a mail merge document. In the document I've put
something like:

{ DATABASE \d "{ MERGEFIELD table_csv_file }" \l "2" \b "47" \*
MERGEFORMAT }

I then write a temporary CSV file, put the filename in the
table_csv_file field in my main CSV file and kick off the mail merge
using the latter as its data source.

It basically works. Unfortunately when the template document is first
loaded I get the error:

"This data source cannot be opened because it is not supported by the
application"

If I click 'OK', it carries on and merges correctly, including the
table. It seems to be complaining because before the merge takes place
the field is unset and therefore doesn't point to a valid data source.
Any ideas how I can suppress this error or get around it some other
way?

Many thanks for any help,
Martin.