PrintJob.Priority Property

Gets the print job's Priority in the printer spool queue.

[Visual Basic]
Public ReadOnly Property Priority As Integer
[C#]
public int Priority {get;}
[C++]
public: __property int get_Priority();
[JScript]
public function get Priority() : int;

Property Value

Gets the print job's priority. Jobs with a higher priority should be printed ahead of jobs with a lower priority.

Remarks

This value can be between 1 (lowest) and 99 (highest)

Throws an InsufficentPrintJobAccessRightsException if set and the logged in user does not have sufficient privilege to alter this print job

Example

[Visual Basic] The following example sets the "BigBoss" user priority to the highest

[Visual Basic] 
Private mPr As PrinterMonitorComponent

Public Sub StartWatching(ByVal PrinterDeviceName As String)

   mPr = New PrinterMonitorComponent()

   '\\ For efficieny reasons, do not monitor printer information changed events
   mPr.MonitorPrinterChangeEvent = False

   AddHandler mPr.JobAdded, AddressOf Addedtest

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

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

   With CType(e, PrintJobEventArgs).PrintJob
	If .Username = "BigBoss"
          Try
            .Priority = 99
            .Commit()
          Catch ej As PrinterQueueWatch.PrinterMonitoringExceptions.InsufficentPrintJobAccessRightsException
       Debug.Write("You cannot change this print job")
          End Try
        End If
   End With

End Sub

Requirements

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.