currentPrinter

Description

Specifies the printer to print to. Only the exact printer name strings as they appear on Internet Explorer's Print dialog can be specified. If the string does not exist or is written incorrectly, printing will be directed to the default printer.

The internal implementation of writing to the currentPrinter property is exactly the same as writing to the printer property, other than the implementation of currentPrinter does not ‘eat’ any error. Therefore an error in currentPrinter will be reported in the same way as any other error that occurs in an ActiveX object property/method call (e.g. in javascript, an error with be thrown that can be caught by the use of a try … catch block).

With javascript, take care to double any backslashes that appear in the printer name.

This is a read/write property.

Syntax

printing.currentPrinter = sPrinterName

Example