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.

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