IMAPISupport::CreateOneOff

Last modified: July 23, 2011

Applies to: Outlook

Creates an entry identifier for a one-off address.

HRESULT CreateOneOff(
  LPSTR lpszName,
  LPSTR lpszAdrType,
  LPSTR lpszAddress,
  ULONG ulFlags,
  ULONG FAR * lpcbEntryID,
  LPENTRYID FAR * lppEntryID
);

lpszName

[in] A pointer to the display name of the recipient the PR_DISPLAY_NAME (PidTagDisplayName) property. The lpszName parameter can be NULL.

lpszAdrType

[in] A pointer to the address type (such as FAX, SMTP, or X500) of the recipient. The lpszAdrType parameter cannot be NULL.

lpszAddress

[in] A pointer to the messaging address of the recipient. The lpszAddress parameter cannot be NULL.

ulFlags

[in] A bitmask of flags that affects the one-off recipient. The following flags can be set:

MAPI_SEND_NO_RICH_INFO

The recipient cannot handle formatted message content. If MAPI_SEND_NO_RICH_INFO is set, MAPI sets the recipient's PR_SEND_RICH_INFO (PidTagSendRichInfo) property to FALSE. If MAPI_SEND_NO_RICH_INFO is not set, MAPI sets this property to TRUE unless the recipient's messaging address pointed to by lpszAddress is interpreted to be an Internet address. In this case, MAPI sets PR_SEND_RICH_INFO to FALSE.

MAPI_UNICODE

The display name, address type, and address are in Unicode format. If the MAPI_UNICODE flag is not set, these strings are in ANSI format.

lpcbEntryID

[out] A pointer to the count of bytes in the entry identifier pointed to by the lppEntryID parameter.

lppEntryID

[out] A pointer to a pointer to the entry identifier for the one-off recipient.

S_OK

The one-off entry identifier was successfully created.

The IMAPISupport::CreateOneOff method is implemented for all service provider support objects. Service providers call CreateOneOff to create an entry identifier for a one-off recipient (a recipient that does not belong to any of the containers from any of the currently loaded address book providers).

When you are finished using the entry identifier returned by CreateOneOff, free the memory allocated for the entry identifier by using the MAPIFreeBuffer function.

Support the Transport Neutral Encapsulation Format (TNEF) and use the value of the PR_SEND_RICH_INFO property to determine whether to use TNEF when you transport a message. Not supporting TNEF or not sending a message in this format when it is requested can be a problem for form-based clients or clients that require custom MAPI properties. This is because TNEF is typically used to send custom properties for custom message classes.

Show:
© 2014 Microsoft