Article ID: 209976 - View products that this article applies to.
This article was previously published under Q209976
For a Microsoft Access 97 version of this article, see 159328Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access database (.mdb).
This article shows you how to use Visual Basic for Applications to run a Microsoft Word mail merge in Microsoft Access.
By using Visual Basic for Applications, you can perform a mail merge in a Microsoft Word document from a Microsoft Access module. The example in this article uses the OpenDataSource and Execute methods of the MailMerge object in Word. It also demonstrates how to send a mail merge document directly to the printer.
Example: Mail Merge a Microsoft Access Query with a Word DocumentThe following example opens a Word document called C:\MyMerge.doc and runs a mail merge by using the Customers table in the Microsoft Access sample database Northwind.mdb as its data source. The following sample code assumes that the main document for the merge, C:\MyMerge.doc, already exists.
For more information about creating mail merge documents, click Microsoft Word Help on the Help menu, type use mail merge to create form letters in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.
For more information about using data from Microsoft Access tables or queries in mail merge, click Microsoft Access Help on the Help menu, type merge data from a table or query by using the microsoft word mail merge wizard in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.
Article ID: 209976 - Last Review: August 6, 2004 - Revision: 3.0
Contact us for more help