#1
|
|||
|
|||
Mail Merge Macro
I want to open a template that I have in word and it when it opens a message box appears and asks me to select recipients (excel file) for mail merging. After that I want another message box to appear that asks me to find recipients. Any Suggestions? |
#2
|
||||
|
||||
Add the following code to the template
Code:
Option Explicit Sub AutoNew() Dialogs(wdDialogMailMergeSetDocumentType).Show If ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument Then MsgBox "No a merge document!" GoTo lbl_Exit End If Dialogs(wdDialogMailMergeOpenDataSource).Show Dialogs(wdDialogMailMergeRecipients).Show lbl_Exit: Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
This code actually partially helps me out! Thank you,
Is there a way to Finish and merge All Records after this is ran? Would be nice to just auto-open the new document after this macro is used. Another issue I had was trying to put this into my Custom Ribbon and it keeps giving me "Argument not optional" But when I manually select it to run under the developer tab it runs fine. |
Tags |
macros in word, mail merge, selecting recipients |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mail Merge Macro | ch1325 | Word VBA | 2 | 06-08-2015 06:18 AM |
Help Please: New VBA user trying to use a macro to split Mail Merge documents. Two Run-Time Error | zipit189 | Word VBA | 7 | 03-18-2015 01:13 PM |
Macro to loop through all cells in a table produced by a mail merge | elh52 | Word VBA | 4 | 08-31-2014 10:50 PM |
Mail merge how to link mail merge field value to a column heading | dsummers | Mail Merge | 1 | 05-08-2014 02:59 PM |
Word Doc Macro (mail Merge) | ajolson1964 | Word VBA | 1 | 05-10-2011 10:15 PM |