Running Word Mail Merge from Access 2010

psycoperl

Active Member
Joined
Oct 23, 2007
Messages
339
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
  3. Web
I would like to be able to with a click of a button on my form in my Access application have a document merged with the results with my query and printed.

Is this possible.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
In Access 2007 the External Data (fourth) ribbon has a Word Merge button. Doesn't 2010 have something similar?
 
Upvote 0
I was thinking of needing to do this via VBA as I need other steps to be included in my process
 
Upvote 0
You need a Word mail-merge main document whose database comes from your query, then you need a macro in Access which simply opens that document, whereupon Word will execute the query. So most of the work has to be done in Word.

Open your Word document, or create a new one. Go to the Mailings ribbon and click on Start Mail Merge to choose the type (Normal kills all mail-merging, and Step By Step option shows the old Word 2003 wizard). Next, click Select Recipients and choose Use Existing List -- here's where you'll point to your query: drop down the button that says All Data Sources, choose Access Databases or Access 2007 Database, whichever is appropriate, navigate to your Access database, Open it, and you'll see a list of all its tables and queries ("VIEW"s), so pick the one you want.

Now you're back at the main document, so you have to type text and occasionally click the Insert Merge Field button, whose list will contain your query's fields, to put a query-data field into the main document. Save this main document, and back in Access, create a macro than opens it. When the user runs the macro, they'll just have to click Finish & Merge on the Mailings ribbon.
 
Upvote 0
Doing it manually from Word is defeinitely an option, as jasmith points out. But there are several ways to do it using VBA, depending on the final desired output.
Helen Feddema has written a lot of stuff on this; one link is here, which provides another link to a more recent update.

Denis
 
Upvote 0
Hi Denis,
i will without a doubt be taking a closer look at that article, thanks. I just printed it out for when I go on my break.

I currently have set it up to do a manual merge in word like I have been doing on other projects to tide us over until I can get this VBA done.

Thanks again.
 
Upvote 0
My solution doesn't involve VBA, either in Word or Access. Once you create and save the mail-merge main document in Word that points to your Access query, create a macro in Access with one RunApp action whose argument is the proper command line to open Word and open the main-document file. I have Office 2003, so for me it would be:

"C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" "pathandfilename"

...with the quotes (because of spaces in the path and file names).
 
Upvote 0
@jasmith4

The process that I am attempting to automate requires once we issue the letter/ticket marking it as printed with the date/time for record keeping requirements.

What we are doing is right now, i have a 3 step process that I would like to shorten to as few steps to avoid issues with other people running the system when I am on vacation -- they need the fewest number of steps possilble. ( A/K/A I need to make it Dummy, Idiot, Senior and Non-Technical Person Proof)

Step 1 is Create Appointments by VBA.

Step 2 is copy appointment information and "merge it" with other data to another "temp" table to use in the mail merge, again via VBA processes

Step 3 is having to go to Word and do the merge and print

Step 4 is running another set of VBA that marks the appointments listed in the temp table as printed in the appointment table and delete them from the temp table.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top