View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default Heavy Mail Merge Application

Hi Atul,

I am currently creating an application which allows users to choose a list
of database fields and include them into a main mail merge document. Once
this step is complete I will allow the user to modify the main mail merge
document file and insert merge fields and standard body text.

After research I found one way of adding these merge fields to the document
was to create a text file (with all the merge field names) and linking this
to the main merge document using the OpenHeaderSource property. Is there any
other way of doing this? Rememeber, I will be exporting the selected merge
fields from an external application and linking this with Word to create a
main mail merge document.

From what I hear, this approach no longer works in more recent versions of
Word. Word requires at least one data record in order to provide a list of
field names for insertion into the document.

What I generally tend to do is use ADO (or whatever connection method is most
appropriate) to link to the data source, read the field names, then populate a
list of some sort. When the user selects a field name, code attached to the
control inserts a mergefield.

My second question is: If my application extracts the merge data source into
one large text file, can I use ADO to grab a subset of these records,
perform a merge and then move onto the next subset (defined by differing
criteria). I would like this approach as I do not want to read in the entire
datasource, perform filtering and then merge, save and close the document.
Then repeat the read, filter and merge. Is this possible?

Word's mail merge can work ONLY with a file saved to a "traditional" path (no
URL, only file paths). You shouldn't need to close the document between
changing the filter settings (QueryString property), if that helps at all...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)