ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   runnung word (https://www.excelbanter.com/excel-programming/395518-runnung-word.html)

Curt

runnung word
 
Built a macro in word it works fine. When I copied it to Excel it runs until
the point of merge then stops. If you click on merge it will continue. Would
like to have it go thru the merge and stop when it hits printer. Others can
input ok for printer. Following is code that stops when hitting merge. Any
one with an idea I an frustrated. Thanks

Selection.TypeParagraph
Selection.TypeParagraph
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM C:\Parade\mailEcopy.xls WHERE ((Contact_Person IS NOT
NULL ))" _
& ""
With ActiveDocument.MailMerge ----------------------
.Destination = wdSendToPrinter
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = False
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True



All times are GMT +1. The time now is 12:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com