PDA

View Full Version : Solved: Macro to Run a Mail Merge



Anne Troy
06-15-2004, 08:35 AM
Assuming that I have a mail merge file already set up to run with my Access database, how can I run that from my database? Assume file name is c:\My Documents\mymerge.doc

Thanks!!

___
06-15-2004, 08:45 AM
Create a query in the db containing the data required, then use that query as the data source for your doc. You shouldn't have to run anything from within the db.

HTH

___
06-15-2004, 08:51 AM
Or did you mean open the .doc?

Anne Troy
06-15-2004, 08:53 AM
Actually, the user wants to run the mail merge from the DB, not the doc...see? We're assuming that the mail merge is already set up to the appropriate table/query/whatever.

___
06-15-2004, 08:54 AM
To open the .doc from a form in the db, I'd use the Follow Hyperlink method in the Onclick event of a button.

Application.FollowHyperlink "c:\My Documents\mymerge.doc", , True, True

HTH

Anne Troy
06-15-2004, 08:59 AM
Okay. I've advised the asker to record a macro to run the mail merge, put that code into the Document_Open, and save the doc file.

Then to create a command button and put that code behind it.

Thanks!!