#1   Report Post  
Posted to microsoft.public.word.docmanagement
Dirdata via OfficeKB.com Dirdata via OfficeKB.com is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro execution using MailMerge nelsonj Mailmerge 9 June 13th 06 05:04 PM
Word mailmerge to PDF macro Martin Mailmerge 2 April 13th 06 06:31 AM
Mailmerge by macro J.Reynolds Mailmerge 5 June 17th 05 09:36 PM
Macro for a Table in a MailMerge Jeanne Moos Mailmerge 1 January 12th 05 03:36 AM
Macro to Find/Replace (with MailMerge Field)? aiyou Mailmerge 1 December 8th 04 07:39 AM


All times are GMT +1. The time now is 05:59 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"