IMAPIViewAdviseSink::OnPrint
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Notifies the form viewer of the printing status of a form.
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 Value
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.