IMAPIViewContext::GetPrintSetup

The IMAPIViewContext::GetPrintSetup method retrieves current printing information.

Quick Info

See IMAPIViewContext : IUnknown.

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 hDevNames 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