Visual Basic: MAPI Controls

MAPISession Control

See Also    Example    Properties    Methods    Events

The messaging application program interface (MAPI) controls allow you to create mail-enabled Visual Basic MAPI applications. There are two MAPI controls:

  • MAPISession

  • MAPIMessages

The MAPISession control signs on and establishes a MAPI session. It is also used to sign off from a MAPI session. The MAPIMessages control allows the user to perform a variety of messaging system functions.

Syntax

MAPISession

Remarks

After sign-on is successful, the SessionID property contains the handle to the MAPI session. The session handle must then be passed to the MAPIMessages control or an error results when using the MAPIMessages control.

The MAPISession control is invisible at run time. In addition, there are no events for the control. To use it, you must specify the appropriate properties and methods.

For these controls to work, MAPI services must be present. MAPI services are provided in MAPI compliant electronic mail systems.

Note   If you attempt to run a program that uses the MAPI controls, make sure that you have the 32-bit MAPI DLLs installed properly or you may not be able to perform simple MAPI functions such as SignOn. For example, on Windows 95 or later, you must install Exchange during the operating system setup, or install it separately from the control panel to correctly use MAPI functions or MAPI custom controls from Visual Basic.