Recorded Macro to Print Merge to Printer Requires SendKeysID: 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
the Microsoft fee-based consulting line at (800) 936-5200. For more
information about the support options available from Microsoft, please see
the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/
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
Keywords : kbprint kbdta kbdtacode wordnt kbmacroexample winword kbmerge ntword macword word6 winword2 word7
Version : WINDOWS:2.0,2.0a,2.0a-CD,2.0b,2.0c,6.0,6.0a,6.0c,7.0,7.0a; winnt:6.0
Platform : WINDOWS winnt
Issue type : kbhowto
Last Reviewed: May 19, 1999