MAPIDetails

Syntax

MAPIDetails(Session, UIParam, Recipients, RecipIndex, Flags, Reserved)

Remarks

Displays a dialog box that provides the details of a recipient in a recipient list. Use the RecipIndex argument to specify which recipient to display. Use MAPIQueryRecipientListCount to determine the number of recipients in
a list.

The dialog box cannot be suppressed. The caller can make the entry either modifiable or fixed. The call works only for recipients that have been resolved either as the recipients of read mail, resolved entries returned by MAPIAddress, or entries returned by MAPIResolveName.

The folder the entry belongs to determines the amount of information presented in the details dialog box. It contains at least the friendly name and address of the recipient.

Argument

Explanation

Session

An opaque session handle whose value represents a session
with the messaging system. Session handles are returned by MAPILogon and invalidated by MAPILogoff. If the value is
0 (zero), the messaging system sets up a session from a system default session (if one exists) or presents a log-in dialog box. In
all cases, the messaging system returns to its state before the call.

UIParam

The parent window handle for the dialog box. A value of 0 (zero) specifies that any dialog box displayed is application modal.

Recipients

A handle to the recipient list containing the entry whose details
are to be displayed.

RecipIndex

The index of the recipient to display. Recipients are numbered from 0 (zero) to MAPIQueryRecipientListCount minus 1.

Flags

A bitmask of flags. Unspecified flags should always be set to
0 (zero). Undocumented flags are reserved. The following flags
are defined:

MAPI_LOGON_UI = 1
MAPI_NEW_SESSION = 2
MAPI_AB_NOMODIFY = 1024

Set MAPI_LOGON_UI if the function should display a log-in dialog box (if required). When this flag is not set, the function does not display a dialog box and returns an error if the user is not logged in.

Set MAPI_NEW_SESSION if you want to establish a session other than the current one. For instance, if a mail client is already running, another MAPI e-mail client can piggyback on the session created by the mail client application. Do not set this flag if you want the default session (if it still exists). If the session passed in Session is not 0 (zero), this flag is ignored.

Set MAPI_AB_NOMODIFY if the details of the entry should not be modifiable even if the entry belongs to the personal address book.

Reserved

Reserved for future use. This argument must be 0 (zero).


The following table lists the possible return values of the MAPIDetails function and their meanings.

Value

Name

Meaning

–21

MAPI_E_AMBIGUOUS_RECIPIENT

The recipient is not a resolved recipient. No dialog box was displayed.

–2

MAPI_E_FAILURE

One or more unspecified errors occurred while matching the message type. The call failed before message type matching could take place.

–5

MAPI_E_INSUFFICIENT_MEMORY

There was insufficient memory
to proceed. No dialog box was displayed.

–3

MAPI_E_LOGIN_FAILURE

There was no default log-in,
and the user failed to log in successfully when the log-in dialog box was displayed. No dialog box was displayed.

–26

MAPI_E_NOT_SUPPORTED

The operation was not supported by the underlying messaging system.

–1

MAPI_USER_ABORT

The user canceled the process.
No dialog box was displayed.

0

SUCCESS_SUCCESS

The function returned successfully.


Example

The following example displays a standard Mail Address Book dialog box, then the details for the last recipient selected by the user. The user cannot modify the details.


Sub MAIN
MAPI_LOGON_UI = 1
Session = MAPILogon(0, "", "", MAPI_LOGON_UI, 0)
RecipList = MAPIAddress(Session, 0, "Address Book", 4, "", 0, 0)
RecipCount = MAPIQueryRecipientListCount(RecipList)
MAPI_AB_NOMODIFY = 1024
result = MAPIDetails(Session, 0, RecipList, RecipCount - 1,\
MAPI_AB_NOMODIFY, 0) result = MAPILogoff(Session, 0, 0, 0) End Sub