Directory Services

IADsPrintJobOperations Property Methods

The property methods of the IADsPrintJobOperations interface read and write the properties described in the following table. For a general discussion of property methods, see Interface Property Methods.

Properties

Property Description
Status

[Visual Basic]
Access: Read-only
DataType: Long

[C++]
HRESULT get_Status
([out] LONG* plStatus);

The current status of service. The status is indicated by one of the integer values found in the following table.
Status Hex Value
ADS_JOB_PAUSED ADS_JOB_ERROR ADS_JOB_DELETING ADS_JOB_PRINTING ADS_JOB_OFFLINE ADS_JOB_PAPEROUT ADS_JOB_PRINTED ADS_JOB_DELETED 0x00000001 0x00000002 0x00000004 0x00000010 0x00000020 0x00000040 0x00000080 0x00000100
TimeElapsed

[Visual Basic]
Access: Read-only
DataType: Long

[C++]
HRESULT get_TimeElapsed
([out] LONG* plTimeElapsed);

Time elapsed, in seconds, since the print job started.
PagesPrinted

[Visual Basic]
Access: Read-only
DataType: Long

[C++]
HRESULT get_PagesPrinted
([out] LONG* plPagesPrinted);

Number of pages printed.
Position

[Visual Basic]
Access: Read/Write
DataType: Long

[C++]
HRESULT get_Position
([out] LONG* plPosition);
HRESULT put_Position
([in] LONG lPosition);

Position in the print queue of this print job.

Example Code [Visual Basic]

The following code example shows how the properties for IADsPrintJobOperations may be used.

Dim pqo As IADsPrintQueueOperations
Dim pjo As IADsPrintJobOperations

On Error GoTo Cleanup

Set pqo = GetObject("WinNT://aMachine/aPrinter")
For Each pj In pqo.PrintJobs
	Set pjo = pj
	MsgBox pjo.PagesPrinted & " pages printed for job " & pj.Name
	If (pjo.position > 1) Then
		pjo.Position = pjo.status - 1
	End If
Next

Cleanup:
	If (Err.Number<>0) Then
		MsgBox("An error has occurred. " & Err.Number)
	End If
	Set pqo = Nothing
	Set pjo = Nothing

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.

See Also

IADsPrintJob, IADsPrintJobOperations, IADsPrintQueue