WD: Recorded Macro to Mail Merge to Printer Requires SendKeys |
Q187637
In order to use a macro to send a merged a document directly to the printer, the macro must include the SendKeys macro command. Without the SendKeys macro command, the Print dialog box remains on the screen.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please see the following page on the World Wide Web:
http://www.microsoft.com/partner/referral/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://support.microsoft.com/directory/overview.asp
Sub MAIN
SendKeys "{enter}"
MailMergeToPrinter
End Sub
Sub MAIN
MailMergeToDoc
FilePrint
FileClose 2
End Sub
Sub MAIN
FilePrintMerge .MERGERECORDS = 0, .From = "", \
.To = "", .PRINT
FilePrint .Type = 0, .NumCopies = "1", .Range = 0,\
.From = "", .To = "", .Reverse = 0, .Draft = 0,\
.UpdateFields = 0, .PaperFeed = 8, .Summary = 0, \
.Annotations = 0, .ShowHidden = 0, .ShowCodes = 0,\
.FileName = ""
End Sub
SendKeys "{enter}", -1
SendKeys "N{ENTER}", -1 Additional query words: appears automatic mailmerge printmerge print merge
Keywords : kbprint kbdta kbdtacode wordnt kbmacroexample winword kbmerge ntword macword word6 winword2 word7
Issue type : kbhowto
Technology : kbWordSearch kbWordWSearch
|
Last Reviewed: December 29, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |