Programming with Reflection
DefaultPrinter property
Syntax |
|
Works with |
|
Data type |
Returns (first syntax line) or specifies (second syntax line) the default printer to which Reflection should send printer output. Assigning a default printer with this property has no effect on the default printer used by other Windows applications.
The default printer string consists of the printer name, driver, and port as shown in these examples:
Session.DefaultPrinter = "HP LaserJet 4,WINSPOOL,\\Mynet\Myprint"
Session.DefaultPrinter = "Epson AP-4000,WINSPOOL,LPT1:"
You can use the macro recorder to help you determine the correct string for your system by recording your actions as you select the name of the printer you want to use in the Print Setup dialog box.
Notes
To force Reflection to always use the default printer specified in Windows Control Panel, set this property to an empty string. The following commands make this change and save it to the current settings file:
Session.DefaultPrinter = ""
Session.SaveSettings Session.SettingsFile
This can be useful, for example, for a system administrator who is creating one settings file to distribute to many users. Because users are probably not all printing to the same printer, setting DefaultPrinter to an empty string forces Reflection to look for each user's individual default printer; this reduces the risk of printing failure.
The default value is determined by printer selected in Reflection's Print Setup dialog box.