Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
MailMerge Macro HELP
I created the following macro in word.
Sub MailMerge() ' ' MailMerge Macro ' Macro recorded 09/28/06 by DirData ' With ActiveDocument.MailMerge .Destination = wdSendToPrinter .MailAsAttachment = False .MailAddressFieldName = "" .MailSubject = "" .SuppressBlankLines = True x = 1 For Y = 1 To 10970 With .DataSource .FirstRecord = x .LastRecord = x + 9 End With .Execute Pause:=True Let x = x + 10 Next Y End With End Sub the above macro will do a mail merge 10 records at a time, and send them to my printer. But, what it does, that i don't like is that it has me click the OK button after each 10th record. How can i have this macro not ask me to hit the OK button??? Thanks Gary T -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ement/200610/1 |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
MailMerge Macro HELP
Hi Dirdata,
I created the following macro in word. Sub MailMerge() ' ' MailMerge Macro ' Macro recorded 09/28/06 by DirData ' With ActiveDocument.MailMerge .Destination = wdSendToPrinter .MailAsAttachment = False .MailAddressFieldName = "" .MailSubject = "" .SuppressBlankLines = True x = 1 For Y = 1 To 10970 With .DataSource .FirstRecord = x .LastRecord = x + 9 End With .Execute Pause:=True Let x = x + 10 Next Y End With End Sub the above macro will do a mail merge 10 records at a time, and send them to my printer. But, what it does, that i don't like is that it has me click the OK button after each 10th record. How can i have this macro not ask me to hit the OK button??? Some things to try, but no guarantees (except on the last) 1. See if setting Application.DisplayAlerts = wdAlertsNone helps 2. Put a SendKeys in (you'll have to test for the best place in the code - Send Keys is tricky) to dismiss the message: SendKeys "{Enter}" 3. Perform the merge to a new document, then use the macro on that to print 10 pages at a time. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro execution using MailMerge | Mailmerge | |||
Word mailmerge to PDF macro | Mailmerge | |||
Mailmerge by macro | Mailmerge | |||
Macro for a Table in a MailMerge | Mailmerge | |||
Macro to Find/Replace (with MailMerge Field)? | Mailmerge |