IMAPIViewContext::GetPrintSetup

Applies to: Office 2010 | Outlook 2010 | Visual Studio

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

Reference

FORMPRINTSETUP

IMAPIViewContext : IUnknown