MailSession Property [Excel 2003 VBA Language Reference]

Returns the MAPI mail session number as a hexadecimal string (if there's an active session), or returns Null if there's no session. Read-only Variant.

Remarks

This property applies only to mail sessions created by Microsoft Excel (it doesn't return a mail session number for Microsoft Mail).

This property isn't used on PowerTalk mail systems.

Example

This example closes the established mail session, if there is one.

If Not IsNull(Application.MailSession) Then Application.MailLogoff

Applies to | Application Object

See Also | MailLogoff Method | MailLogon Method | MailSystem Property | SendMail Method