print cancel

C

Curt

Have the following want to have code reteurn to a userform if print is
canceled by user on print dialog screen. Presently it returns to vba code
this is what I want to correct
Thanks

With ActiveDocument.MailMerge
'.Destination = wdSendToNewDocument
.Destination = wdSendToPrinter
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = False
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
Application.Quit SaveChanges:=wdDoNotSaveChanges
End With
ActiveWindow.Close
 
D

Doug Robbins - Word MVP

See the article "How to do a mail merge to the printer using VBA, without
displaying the Print dialog" at:

http://www.word.mvps.org/FAQs/MailMerge/MergeStraightToPrintrWVBA.htm

Use the information in the second part of the article, modified to

With Dialogs(wdDialogFilePrint)
If .Show <> -1 then
Exit Sub
End if
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top