The information in this article applies to:
SUMMARYIn 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. MORE INFORMATIONMicrosoft 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/ Word 6.x, 7.xAdd a SendKeys statement to send the {ENTER} key to the Print dialog box. The SendKeys statement should precede the MailMergeToPrinter statement, as in the following example:
If you don't need to send the document directly to the printer, you can merge it to a new document and then print it. The following sample macro merges to a new document, prints the document, and then closes the document:
Word 2.xIf a macro is recorded to merge a document to the printer, the macro has the following commands (there may be different values for the parameters, depending on your choices in the dialog boxes):
NOTE: The backward slashes (\) indicate the command is continued on the next line. Do not include the backward slashes in your macro. For the macro to work correctly, you must insert the following command before the FilePrintMerge command:
Multiple Copies: If you want to print more than one copy of your merged document, use the following SendKeys command to modify the Copies box in the Print dialog box:
NOTE: "N" is the number of copies you want to print. References"Microsoft Word for Windows Technical Reference," pages 88-90"Microsoft Word for Windows and OS/2 Technical Reference," pages 251-253 Additional query words: appears automatic
Keywords : kbprint kbdta kbdtacode wordnt kbmacroexample winword kbmerge ntword macword word6 winword2 word7 |
Last Reviewed: May 19, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |