Description
Displays a standard address list dialog box allowing users to create or modify a set of To:, CC: and BCC: recipients. Below is a sample address book display, after running the example code for this function:
Syntax
status = MAPIAddress ([session] [, parent] [, flags] [, caption] [, edits] [, label] [, to] [, cc] [, bcc])
Parameters
The MAPIAddress function has the following parameters.
Parameter | Description |
---|---|
session | Contains a MAPI session handle returned by MAPILogon. If not specified a system default session will be initiated, if possible, or a sign-in dialog box will be displayed. In any case, MAPI will return to its previous state upon completion of the function. |
parent | Contains the name of an OpenInsight parent window. If not specified the dialog box will be application modal. |
flags | Contains information about session initiation. It could be MAPI_LOGON_UI$, MAPI_NEW_SESSION$, or a combination of these flags.
The insert record MAPI_EQUATES contains these flags. You may combine flags by adding them together with an addition sign (+). |
caption | Contains a caption for the dialog box. If not specified the caption "Address Book" will be used. |
edits | Contains the number, from 0 to 4, of edit controls the dialog box should contain. A value of 0 will allow address list browsing only. A value of 1 will include an edit control for To: recipients. A value of 2 will include an edit control for CC: recipients. A value of 3 will include an edit control for BCC: recipients. A value of 4 will include edit controls for each type of recipient supported by the underlying messaging system. If not specified edit controls for all three types of recipients will be included. |
label | Contains a label for the dialog box's To: recipients edit control. If the edits parameter is not 1 this parameter is ignored. If not specified the label "To:" will be used. |
to | On input contains an @FM-delimited list of initial To: recipients for the dialog box. On output contains an @FM-delimited list of the final To: recipients selected by the user. |
cc | On input contains an @FM-delimited list of initial CC: recipients for the dialog box. On output contains an @FM-delimited list of the final CC: recipients selected by the user. |
bcc | On input contains an @FM-delimited list of initial BCC: recipients for the dialog box. On output contains an @FM-delimited list of the final BCC: recipients selected by the user. |
Returns
1 for successful execution or 0 for failure.
If function execution fails, you can retrieve a text error message by calling the Get_Status function. For example, to display an error message on the screen, include the following error handling routine in your code:
Get_Status(ErrMsg)
Msg(@window, ErrMsg)
See also
Example
Subroutine DemoMAPIAddress(var) * Display addressing dialog box starting with Trudy $INSERT MAPI_EQUATES Declare Subroutine Msg, Get_Status Declare Function MAPIAddress flags = MAPI_LOGON_UI$ to = "Trudy Jones" cc = "" lf = char(10) if MAPIAddress(0, 0, flags, "Addressing Demo", 2, "", to,| cc) then swap @FM with ";" in to swap @FM with ";" in cc display = "To: ":to:lf:"CC: ":cc Msg(@window, display) end else Get_Status(display) Msg(@window, display) end return
Remarks
After the addressing dialog completes successfully the to, cc and bcc parameters will be updated to contain the user's final recipient selections.