Platform SDK: MAPI

IMAPIViewAdviseSink::OnPrint

The IMAPIViewAdviseSink::OnPrint method notifies the form viewer of the printing status of a form.

Quick Info

See IMAPIViewAdviseSink : IUnknown.

HRESULT OnPrint(
  ULONG dwPageNumber,   
  HRESULT hrStatus      
);
 

Parameters

dwPageNumber
[in] Number of the last page printed.
hrStatus
[in] An HRESULT value indicating the status of the print job. Possible values are:
S_FALSE
The printing job has finished successfully.
S_OK
The printing job is in progress.
FAILED
The printing job was terminated due to a failure.

Return Values

S_OK
The notification succeeded.
MAPI_E_USER_CANCEL
The user canceled the operation, typically by clicking the Cancel button in a dialog box.

Remarks

Form objects call the IMAPIViewAdviseSink::OnPrint method while printing to inform the viewer of printing progress.

Notes to Callers

If the printing job involves multiple pages, you can call OnPrint after each page is printed. Set dwPageNumber to the page currently being printed and hrStatus to S_OK. When the printing job is complete, call OnPrint with dwPageNumber set to the last page printed and hrStatus set to S_FALSE.

For more information about form notifications, see Sending and Receiving Form Notifications.