Mail Merge to specific document based on record data

T

troy.litwiler

Hi all. I've been trying to figure this out on my own with little
success, as well as searching all of the Word groups I could find.
What I need to do is create a Macro or VBScript that will select a
datasource (AS400 table), sort it by a specified value in each record,
then merge each record to its own document, chosen according to the
value specified. As an example:


A B C
Bed Tom Wolfe
Chair Sue Jones
Wall Jim Smith
Wall John Henry

All records with A=Bed would merge to bed.doc
All records with A=Chair would merge to chair.doc
All records with A=Wall would each merge to wall.doc

I know this is a simplistic description, but I hope it helps describe
what I'm trying to accomplish. Any suggestions, hints, or help would
be greatly appreciated. Thanks in advance.
 
J

Jezebel

You'll need to explain this a little further. You say the you want to "merge
each record to its own document" -- then further on say "All records with
A=Bed would merge to bed.doc" ... These statements are at odds with each
other.

But the general answer is you base your mailmerge on one or more SQL
statements which sort and select the records you want to include in the
merge.
 
T

troy.litwiler

Sorry if that was a little confusing. What I meant was that all
records with A=Bed would merge to the "bed.doc" merge template, and
then save as "tom wolfe.doc". Each table could conceivably hold
several different records types (identified by the 'A='), and each type
would need to merge to its own template (bed.doc, chair.doc, etc), then
each record saved as an individual doocument, auto-named according to
record data. I have the datasource configured already, the merge
templates are created and work if merged manually and individually, and
the autosave and file naming procedure is finished. The part I'm
struggling with is choosing the merge template based onthe individual
record data. I hope this helps clarify things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top