The Logoff method logs off from the MAPI system.
objSession.Logoff( )
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.
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