SETDEFAULTPRINTER

Action

Sets the default printer to which applications send print jobs.

 

Syntax

SETDEFAULTPRINTER ("printer name")

 

Parameters

Printer name

String that specifies the fully qualified name of the printer to set as the default printer. Note that if the printer involved was connected to using AddPrinterConnection, you must include both the servername and the sharename.

Returns

 

0

Default printer set

Error code

Function failed

 

Example

If AddPrinterConnection ("\\vleerbeer\hp laserjet 4") = 0
   ? "Added printer connection...."
   If SetDefaultPrinter ("\\vleerbeer\hp laserjet 4") = 0

      ? "Set default printer to HP LaserJet 4...."

   Endif

Endif