title | ms.service | api_name | ms.assetid | ms.date | ms.localizationpriority | |
---|---|---|---|---|---|---|
Application.MailLogoff method (Project) |
project-server |
|
e8634331-404c-6e01-4ce9-2dac8dcf364c |
06/08/2017 |
medium |
Closes an established MAPI mail session.
expression. MailLogoff
expression A variable that represents an Application object.
Nothing
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
[!includeSupport and feedback]