[FAQ's: OD] How do I create a Mailmerge?
Using Word 2003 as an example...
There are several easy steps in creating a MailMerge document:
Step 1 -
Setup a new Word document and add your verbiage and any images needed in the document as shown in Fig. 1. Note: I have added highlighting and brackets as placeholders for where I wish to insert my MailMerge data for clarity reasons for this FAQ.
Fig. 1 Click on image for larger picture
http://vbforums.com/attachment.php?attachmentid=49924
Step 2 -
Now that the document is ready for configuring it as a MailMerge document we ca start with setting the document type by clicking on the "Main Document Setup" button on the MailMerge toolbar (Fig. 2). If your MailMerge toolbar is not visible then select it by clicking on the "View > Toolbars > Mail Merge" menu item.
Fig. 2
http://vbforums.com/attachment.php?attachmentid=49903
Step 3 -
Choose the MailMerge "Letter" document type (Fig. 3).
Fig. 3
http://vbforums.com/attachment.php?attachmentid=49904
Step 4 -
Next we will setup the DataSource by clicking on the MailMerge "Open DataSource" button on the MailMerge toolbar (Fig. 4).
Fig. 4
http://vbforums.com/attachment.php?attachmentid=49905
Step 5 -
Browse to where your database is located that contains the information you wish to "merge" with the document, select it and click the "Open" button (Fig. 5).
Fig. 5 Click on image for larger picture
http://vbforums.com/attachment.php?attachmentid=49925
Step 6 -
Now that we are connected to our DataSource we will want to highlight the place where we want to insert a MailMerge field and then click on the "Insert Merge Fields" button on the MailMerge toolbar (Fig. 6).
Fig. 6
http://vbforums.com/attachment.php?attachmentid=49940
Step 7 -
This will bring up the "Insert Merge Field" dialog window from which we can select our field and insert it into the document at the highlighted range by clicking the "Insert" button (Fig. 7).
Fig. 7
http://vbforums.com/attachment.php?attachmentid=49913
Step 8 -
Then you will see the highlighted range change to a MailMerge field. You can tell the difference by the addition of the "«FieldName»" (Fig. 8). Close the "Insert Merge Field" dialog window and repeat steps 6 and 7 until all your needed merge fields have been added to the document.
Fig. 8
http://vbforums.com/attachment.php?attachmentid=49914
Step 9 -
This should be the way your document looks now with the merge fields field names being shown.
Fig. 9 Click on image for larger picture
http://vbforums.com/attachment.php?attachmentid=49926
Step 10 -
For easier viewing of the merge fields you can turn on highlighting of the merge fields by clicking on the "Highlight Merge Fields" button on the Mail Merge toolbar (Fig. 10).
Fig. 10 Click on image for larger picture
http://vbforums.com/attachment.php?attachmentid=49927
Step 11 -
Optionally, you can perform manual sorting and filtering by clicking on the "Mail Merge REceipients" button also located on the Mail Merge toolbar (Fig. 11).
Fig. 11
http://vbforums.com/attachment.php?attachmentid=49942
Step 12 -
The "Mail Merge Receipients" dialog window allows you to sort and/or select which receipients you wish to include or exclude from the merge results. Instructions are on the Mail Merge Receipients dialog window (Fig. 12).
Fig. 12
http://vbforums.com/attachment.php?attachmentid=49918
Step 13 -
If you like you can toggle between viewing the merge fields in the document and a preview of the merged data by clicking on the "View Merged Data" button (Fig. 13).
Fig. 13
http://vbforums.com/attachment.php?attachmentid=49943
Step 14 -
Example of "View Merged Data" turned on and "Highlight Merge Fields" also turned on (Fig. 14).
Fig. 14 Click on image for larger picture
http://vbforums.com/attachment.php?attachmentid=49930
Step 15 -
Example of "View Merged Data" turned on with "Highlighting Merge Fields" turned off (Fig. 15).
Fig. 15 Click on image for larger picture
http://vbforums.com/attachment.php?attachmentid=49931
Once you have your MailMerge document you can also automate and modify it via VB 6 or .NET etc.
See my other OD FAQ thread coming soon - How do I modify/execute a Word MailMerge document?
Meow!