Error Sending Keys to FilePrinterSetup with No Default PrinterLast reviewed: February 5, 1998Article ID: Q96923 |
The information in this article applies to:
SUMMARYYou can change printer driver settings such as resolution, paper orientation, and paper size with a Microsoft WordBasic macro that includes the SendKeys command.
Word versions 6.0, 7.0 and NTWhen you are using the SendKeys command, and there is no active printer, you will receive the following error message:
WordBasic Err = 102, Command Failed Word versions 1.xIf no default printer has been set or no printer is active, a macro that uses the SendKeys command to access a printer driver in Word version 1.x for Windows will cause an unrecoverable application error (UAE) (if you are using Microsoft Windows version 3.0) or a general protection (GP) fault (if you are using Windows version 3.1).
MORE INFORMATIONWARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The SendKeys command should only be used to change settings that are not available in the Page Setup dialog box (from the Format menu, choose Page Setup) of Word version 2.0 for Windows. For example, the following macro automates the process of changing the duplex option in the HP LaserJet IIISi printer driver:
Sub MAIN SendKeys "%o", - 1 'Options button SendKeys "%l{enter}{enter}", - 1 'chooses long side and OK button FilePrintSetup .Printer = "HP LaserJet IIISi on LPT1:", .Setup End Sub REFERENCES"Using WordBasic" by WexTech Systems, Inc. and Microsoft Corporation, Microsoft Press, 1992.
|
KBCategory:
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |