IADsPrintJob Property Methods

Property methods for the IADsPrintJob interface get or set the properties described in the following table. For more information, see Interface Property Methods.

Properties

Description

The description of the print job.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_Description(
  [out] BSTR* pbstrDescription
);
HRESULT put_Description(
  [in] BSTR bstrDescription
);

HostPrintQueue

The ADsPath string of the Print Queue that processes the print job.

Access type: Read-only

Scripting data type: BSTR

// C++ method syntax
HRESULT get_HostPrintQueue(
  [out] BSTR* pbstrHostPrintQueue
);

Notify

The user to be notified when job is completed.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_Notify(
  [out] BSTR* pbstrNotify
);
HRESULT put_Notify(
  [in] BSTR bstrNotify
);

NotifyPath

The ADsPath string of the user object to be notified when the print job is completed.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_NotifyPath(
  [out] BSTR* pbstrNotifyPath
);
HRESULT put_NotifyPath(
  [in] BSTR bstrNotifyPath
);

Priority

The priority of the print job.

Access type: Read/write

Scripting data type: LONG

// C++ method syntax
HRESULT get_Priority(
  [out] LONG* plPriority
);
HRESULT put_Priority(
  [in] LONG lPriority
);

Size

The size, in bytes, of the print job.

Access type: Read-only

Scripting data type: LONG

// C++ method syntax
HRESULT get_Size(
  [out] LONG* plSize
);

StartTime

The earliest time when the print job should be started.

Access type: Read/write

Scripting data type: DATE

// C++ method syntax
HRESULT get_StartTime(
  [out] DATE* pdateStartTime
);
HRESULT put_StartTime(
  [in] DATE dateStartTime
);

TimeSubmitted

The time when the job was submitted to the queue.

Access type: Read-only

Scripting data type: DATE

// C++ method syntax
HRESULT get_TimeSubmitted(
  [out] DATE* pdateTimeSubmitted
);

TotalPages

The total number of pages in the print job.

Access type: Read-only

Scripting data type: LONG

// C++ method syntax
HRESULT get_TotalPages(
  [out] LONG* plTotalPages
);

UntilTime

The latest time when the print job should be started.

Access type: Read/write

Scripting data type: DATE

// C++ method syntax
HRESULT get_UntilTime(
  [out] DATE* pdateUntilTime
);

User

The name of user who submitted the print job.

Access type: Read-only

Scripting data type: BSTR

// C++ method syntax
HRESULT get_User(
  [out] BSTR* pbstrUser
);

UserPath

The ADsPath string of the user object that submitted this print job.

Access type: Read-only

Scripting data type: BSTR

// C++ method syntax
HRESULT get_UserPath(
  [out] BSTR* pbstrUserPath
);

Examples

The following code example shows how to work with properties of a print job object.

Dim pqo As IADsPrintQueueOperations
Dim pj As IADsPrintJob
On Error GoTo Cleanup

Set pqo = GetObject("WinNT://aMachine/aPrinter")
For Each pj In pqo.PrintJobs
    MsgBox "Host Printer: " & pj.HostPrintQueue
    MsgBox "Job description: " & pj.Description
    MsgBox "job requester: " & pj.User 
Next

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

The following code example shows how to work with properties of a print job object.

IADsPrintQueueOperations *pqo = NULL;
IADsPrintJob *pJob = NULL;
HRESULT hr = S_OK;
BSTR bstr = NULL;
VARIANT var;
ULONG lFetch = 0;
IDispatch *pDisp = NULL;
IADsCollection *pColl = NULL;
IUnknown *pUnk = NULL;
LPWSTR adsPath =L"WinNT://aMachine/aPrinter";

VariantInit(&amp;var);

hr = ADsGetObject(adsPath, 
                  IID_IADsPrintQueueOperations, 
                  (void**)&amp;pqo);
if(FAILED(hr)){goto Cleanup;}


hr = pqo->PrintJobs(&amp;pColl);

// Enumerate print jobs. Code omitted.

hr = pColl->get__NewEnum(&amp;pUnk);
if(FAILED(hr)){goto Cleanup;}


IEnumVARIANT *pEnum;
hr = pUnk->QueryInterface(IID_IEnumVARIANT,(void**)&amp;pEnum);
if(FAILED(hr)){goto Cleanup;}


// Now Enumerate.
hr = pEnum->Next(1, &amp;var, &amp;lFetch);
if(FAILED(hr)){goto Cleanup;}

while(hr == S_OK)
{
    if (lFetch == 1)    
    {
        pDisp = V_DISPATCH(&amp;var);
        pDisp->QueryInterface(IID_IADsPrintJob, (void**)&amp;pJob);

        pJob->get_HostPrintQueue(&amp;bstr);
        printf("HostPrintQueue: %S\n",bstr);
        SysFreeString(bstr);

        pJob->get_Description(&amp;bstr);
        printf("Print job name: %S\n",bstr);
        SysFreeString(bstr);

        pJob->get_User(&amp;bstr);
        printf("Requester: %S\n",bstr);
        SysFreeString(bstr);

        pJob->Release();
    }
    pDisp->Release();
    VariantClear(&amp;var);
    hr = pEnum->Next(1, &amp;var, &amp;lFetch);
};

Cleanup:
    if(pEnum) pEnum->Release();
    if(pUnk) pUnk->Release();
    if(pColl) pColl->Release();
    if(pqo) pqo->Release();

Requirements

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Iads.h
DLL
Activeds.dll
IID
IID_IADsPrintJob is defined as 32FB6780-1ED0-11CF-A988-00AA006BC149

See also

IADsPrintJob

Interface Property Methods