The property methods of the IADsPrintJobOperations interface read and write the properties listed in the following table. For more information about property methods, see Interface Property Methods.
Properties
PagesPrinted
Contains the number of pages printed.
Access type: Read-only
Scripting data type: LONG
// C++ method syntax
HRESULT get_PagesPrinted(
[out] LONG* plPagesPrinted
);
Position
Contains the position of this print job in the print queue.
Access type: Read/write
Scripting data type: LONG
// C++ method syntax
HRESULT get_Position(
[out] LONG* plPosition
);
HRESULT put_Position(
[in] LONG lPosition
);
Status
Contains the current status of the print job as indicated by one of the ADSI Print Job Status Constants values.
Access type: Read-only
Scripting data type: LONG
// C++ method syntax
HRESULT get_Status(
[out] LONG* plStatus
);
TimeElapsed
Contains the number of milliseconds elapsed since the print job started.
Access type: Read-only
Scripting data type: LONG
// C++ method syntax
HRESULT get_TimeElapsed(
[out] LONG* plTimeElapsed
);
Examples
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
| Requirement | Value |
|---|---|
| Minimum supported client | Windows Vista |
| Minimum supported server | Windows Server 2008 |
| Header | Iads.h |
| DLL | Activeds.dll |
| IID | IID_IADsPrintJobOperations is defined as 32FB6780-1ED0-11CF-A988-00AA006BC149 |
See also
ADSI Print Job Status Constants
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
