You can create great reports with Access (see Chapter 6, Printing Data with Reports), but there are times when it is convenient (or necessary) to create Word documents to print your Access data. You may already have created Word templates, and want to print letters created from these templates using data stored in Access tables. You may need to do a mass mailing, but with more control over data selection than the Word Mail Merge Wizard allows. Or you may need to put Access data into a Word document so that it can be distributed to anyone who has the standard edition of Office, which includes Word, but not Access.
For other ways of distributing documents filled with Access data to persons who don’t have Access, see the section on emailing reports in .snp or .pdf formats in Chapter 12, Working with Outlook.
You may also need to import data from Word. You won’t see a Word selection in the Files of type selection list in the Access Import dialog, but it is possible to import data from Word documents into an Access table, at least if the data is in one or more Word tables. You can write VBA code to do the import, using the Word object model.
This chapter will explain how to use the Word object model to export Access data to Word documents and to import data in Word tables into Access. The following table lists the sample files referenced in this chapter and indicates where they should be placed.
Document Name | Document Type | Place in Folder |
---|---|---|
Avery 5160 Labels.dot | Word template | \Templates\Access Merge |
Avery 5160 Merge Labels.dot | Word template | \Templates\Access Merge |
Avery 5161 Labels.dot | Word template | \Templates\Access Merge |
Avery 5161 Merge Labels.dot | Word Labels template | \Templates\Access Merge |
Avery 5162 Merge Labels.dot | Word Labels template | \Templates\Access Merge |
Boilerplate Contact Letter | Word template | \Templates\Access Merge_BM.dot |
Boilerplate Contact Letter | Word template | \Templates\Access Merge_DP.dot |
Catalog.dot | Word Catalog Merge template | \Templates\Access Merge |
Contact Merge Letter.dot | Word Mail Merge template | \Templates\Access Merge |
Freestyle Contact Letter | Word template | \Templates\Access Merge_BM.dot |
Freestyle Contact Letter | Word template | \Templates\Access Merge_DP.dot |
Northwind Invoice.dot | Word template | \Templates\Access Merge |
One-up Label BM.dot | Word template | \Templates\Access Merge |
One-up Label DP.dot | Word template | \Templates\Access Merge |
Employee Phones.doc | Word document | \My Documents\Access Merge |
Logons and Passwords.doc | Word document | \My Documents\Access Merge |
Word Data Exchange.mdb | Access 2000 database | Wherever you want |