Logoff Method (Session Object)

Logoff Method (Session Object)

The Logoff method logs off from the MAPI system.

Syntax

objSession.Logoff( )

Remarks

The Logoff method terminates a MAPI session initiated by the Logon method. You can log on to the same Session object again. Attempted access to the Session object before logon results in a return of CdoE_NOT_INITIALIZED.

If you have created a ContainerRenderer or ObjectRenderer object while the session was active, you must Set it to Nothing, or Set its DataSource property to Nothing, before you call the Session object's Logoff method. Failure to do so can result in unexpected behavior.

Example

This code fragment logs off from the MAPI system:

' from the function Session_Logoff
If Not objSession Is Nothing Then
    objSession.Logoff
    MsgBox "Logged off; reset global variables"
Else
    MsgBox "No active session"
End If
 

See Also

Concepts

Session Object