Merging Access Data with Word Documents

If all your names and addresses are stored in an Access database and you want to send the same letter to each person, you could compose the letter as an Access report. However, you might want to merge the names and addresses with a Word document that contains the body of the letter instead.

Assuming your names and addresses are already stored in an Access database, you'll also need a letter, which you create in Word as a special type of documenta mail-merge document. Within the body of the letter, you include special field codes that match the name and address field names in your Access database. Then, you merge your Access data with the mail-merge document, and Word inserts the Access data using the field codes as a guide.

Let's create a simple letter to send to all the catalog contacts in your gardening database asking for the most recent catalog. To do so, follow these steps:

  1. In Access, click the Tables shortcut and then select the Catalogs table.

  2. Select Merge It with Microsoft Word from the OfficeLinks button on the Database toolbar to launch the Mail Merge Wizard.

  3. In the wizard's first pane, select the Create a New Document and Then Link the Data to It option because you need to create the letter. Click OK to continue.

  4. The wizard launches Word and opens a new, blank document. The Mail Merge toolbar is also visible.

  5. Enter the current date by selecting Date and Time from the Insert menu. Next, select the third option. If you click the Update Automatically option, Word uses the current date the next time you use the document (if you decide to save it and reuse it). Click OK .

  6. Press Enter four times to add four blank lines.

  7. Now you need to enter your first field code, which is the catalog's name. To do so, click the Insert Merge Field button's drop-down list, select Name , click Insert , and then click Close . Repeat this process until you've inserted all the address field codes (Address, City, State, ZIP, and Country). Be sure to include a comma and space between the City and State fields and a space between the State and ZIP fields. You can select all the fields at once and move them around later, instead of opening and closing the Insert Merge Field dialog box several times.

  8. Press Enter twice and enter To Whom It May Concern: . Then press Enter twice more, and enter the body of the letter and the closing, as shown in Figure 16.10.

    Figure 16.10. The mail-merge document contains both the letter and field codes for the merge.

    graphics/16fig10.jpg

  9. Format the letter, if you want.

  10. When your letter is just the way you want it, you can either create a new document that contains all the letters or send the letters directly to your printer. In this example, you'll create a document to avoid the nuisance of actually printing these sample letters . To do so, click the Merge to New Document button on the Mail Merge toolbar.

  11. In the Merge to New Document dialog box, you can limit the number of letters you print by specifying which Access records actually get merged. You want to send a letter to all your catalogs, so just retain the default option of All , and click OK .

  12. Figure 16.11 shows the first page of your new documentit's a letter to Gurney's (including the correct address). Page through the new document, and you'll find that each page is actually a letter to a catalog. You can save the document and print your letters later, or you can print them now.

    Figure 16.11. The new document contains all your letters.

    graphics/16fig11.jpg

Note

graphics/note.gif

You created your mailmerge letter as part of the merge process. You can work with an existing document just as easily. In step 2, you would select the Link Your Data to an Existing Microsoft Word Document option. Most likely, the document already contains the necessary field codes, but the wizard enables you to change those settings before actually merging anything.


Although the merge process can take a while to set up, the process is simple and the wizard walks you through it.



Absolute Beginner's Guide to MicrosoftR Access 2002
Absolute Beginner's Guide to MicrosoftR Access 2002
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net