Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate from Access 2010 Query to Word 2010 mail merge

Status
Not open for further replies.

DannyRoss

Technical User
Dec 1, 2011
2
ES
Hi everyone!
I've been going through all the previous threads but haven't found exactly what I need. The title says it all....I'm trying to write VBA code so with a simple click, I can create a mail merge document using a predefined template and pulling the information from a query in Access. Problem is I haven't found the code to use it with Access 2010 and Word 2010.
In my case, I want word to open "Template1.doc" as the template document, using information from query "List" in "Database.acdb", and after having the mail merge executed, create a new document called: report.doc.
I've seen that within years the VBA code has change and I'm not sure if I have to use a SetQuery function, Mailmerge function, etc. Can anyone help me?
 
What part of this can you do and what part of this do you need help on?
1)Launching a template from Access
2)Building a mailmerge template

If you are proficient in makeing mailmerge templates, then you just may need the code to launch the template from wihtin Access (if that is the requirement). If you need to learn how to do mailmerge that is better done through reading on the internet then expecting someone to explain it in a thread.

I often use word templates to generate reports from my access database. In my access database I have means to launch the templates. The templates then have the code to connect to the database and pull the data. The code in the templates does all the formatting and placement of the data. By placing all the code in the templates and not in the database it makes modifications and changes much more flexible. However this requires proficiency in Access vba and Word vba programming.
 
I haven't been as clear as I planned, sorry. I actually have a template created for mail merge, linked to a query from Access. What I'm looking for is the code for a button to automatically launch the template from within Access, execute the mail merge for a specific record, and paste it on a new document (which I can save, print or do whatever I want).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top