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.

ParameterDescription
sessionContains 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.
parentContains the name of an OpenInsight parent window. If not specified the dialog box will be application modal.
flagsContains information about session initiation. It could be MAPI_LOGON_UI$, MAPI_NEW_SESSION$, or a combination of these flags.
  • MAPI_LOGON_UI$ indicates that MAPI should display a sign-in dialog box, if necessary. If the session parameter is specified this flag is ignored.
  • MAPI_NEW_SESSION$ indicates that MAPI should establish a new session and not attempt to share another MAPI client's session or the default session. If the session parameter is specified this flag is ignored.

The insert record MAPI_EQUATES contains these flags. You may combine flags by adding them together with an addition sign (+).

captionContains a caption for the dialog box. If not specified the caption "Address Book" will be used.
editsContains 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.
labelContains 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.
toOn 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.
ccOn 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.
bccOn 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

Get_Status()MAPISendMail()

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.

  • No labels