PrintJob.PrinterName Property

Gets the name of the printer that this job is (or was) queued against

[Visual Basic]
Public ReadOnly Property PrinterName As String
public string PrinterName {get;}
public: __property string get_PrinterName();
public function get PrinterName() : string;

Property Value

Set to the device name of the printer queue to be monitored. You can find out this name from the Printers section of the windows control panel



[Visual Basic] The following example prints the name of the printer to a trace when a job is deleted from the queue being monitored

[Visual Basic] 
Private mPr As PrinterMonitorComponent

Public Sub StartWatching(ByVal PrinterDeviceName As String)

   mPr = New PrinterMonitorComponent()

   AddHandler mPr.JobDeleted, AddressOf Deletedtest

   mPr.ThreadTimeout = -1
   mPr.DeviceName = PrinterDeviceName 
End Sub

Public Sub Deletedtest(ByVal sender As Object, ByVal e As EventArgs)

   With CType(e, PrintJobEventArgs).PrintJob
	Trace.WriteLine(.PrinterName & " - had a job deleted")
   End With
End Sub


Namespace: PrinterQueueWatch

Platforms:  Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

See Also

PrintJob overview , All PrintJob members

© 2003 Merrion Computing Ltd. All rights reserved.