Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.MailLogoff Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Closes an established MAPI mail session.

Syntax

expression. MailLogoff

expression A variable that represents an Application object.

Return Value

Nothing

Example

The following example checks for an existing mail session and logs off it. If not logged on, the following example logs on, downloads any new mail, and then logs off.

Sub LogoffFromMail() 

 If Not IsNull(MailSession) Then 
 MsgBox "Logging off mail session: " &; MailSession 
 Application.MailLogoff 
 Else 
 MsgBox "Logging on to mail session now." 
 Application.MailLogon DownloadNewMail:=True 
 MsgBox "Logging off mail session: " &; MailSession 
 Application.MailLogoff 
 End If 

End Sub
© 2018 Microsoft