IMAPIViewContext::GetPrintSetup

Applies to: Outlook 2013 | Outlook 2016

Retrieves current printing information.

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

Parameters

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.

Return value

S_OK

The printing information was successfully retrieved.

Remarks

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

Notes to implementers

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

Notes to callers

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.

See also

FORMPRINTSETUP

IMAPIViewContext : IUnknown