PrintJob.Document Property

Gets the name of the document that this print job was created from

[Visual Basic]
Public Property Document As String
public string Document {get;set}

Property Value

Set to the name of the document from which this print job was created


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


[Visual Basic] The following example changes the document name when it is added

[Visual Basic] 
Private mPr As PrinterMonitorComponent

Public Sub StartWatching(ByVal PrinterDeviceName As String)

   mPr = New PrinterMonitorComponent()

   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 .Document = "CV.doc" Then
           .Document = "Not a CV.doc"
         Catch ej As PrinterQueueWatch.PrinterMonitoringExceptions.InsufficentPrintJobAccessRightsException
       Debug.Write("You cannot change this print job")
     End Try
   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.