IMAPIViewContext::GetPrintSetup

Last modified: July 23, 2011

Applies to: Outlook

Retrieves current printing information.

HRESULT GetPrintSetup(
ULONG ulFlags,
LPFORMPRINTSETUP FAR * lppFormPrintSetup
);

ulFlags

[in] Bitmask of flags that controls the type of the returned strings. The following flag can be set:

MAPI_UNICODE

The returned strings are in Unicode format. If the MAPI_UNICODE flag is not set, the strings are in ANSI format.

lppFormPrintSetup

[out] Pointer to a pointer to a structure that holds the printing information.

S_OK

The printing information was successfully retrieved.

Form objects call the IMAPIViewContext::GetPrintSetup method to retrieve information about the printer setup before attempting to print the current message.

Allocate the hDevMode and hDevName members of the FORMPRINTSETUP structure using the Win32 function GlobalAlloc.

If you expect the hDevMode and hDevName members of the FORMPRINTSETUP structure pointed to by the lppFormPrintSetup parameter to be Unicode strings, set ulFlags to MAPI_UNICODE. Otherwise, GetPrintSetup will return these strings in ANSI format.

Free the hDevMode and hDevName members of the FORMPRINTSETUP structure by calling the Win32 function GlobalFree. Free the entire FORMPRINTSETUP structure by calling MAPIFreeBuffer.

Show: