Skip to content

Latest commit

 

History

History
54 lines (33 loc) · 1.56 KB

Excel.Application.MailLogon.md

File metadata and controls

54 lines (33 loc) · 1.56 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Application.MailLogon method (Excel)
vbaxl10.chm133158
vbaxl10.chm133158
Excel.Application.MailLogon
0a6c8752-739d-b996-1426-4d3021ea5323
04/05/2019
medium

Application.MailLogon method (Excel)

Logs on to MAPI Mail or Microsoft Exchange and establishes a mail session. If Microsoft Mail isn't already running, you must use this method to establish a mail session before mail or document routing functions can be used.

Syntax

expression.MailLogon (Name, Password, DownloadNewMail)

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Name Optional Variant The mail account name or Microsoft Exchange profile name. If this argument is omitted, the default mail account name is used.
Password Optional Variant The mail account password. This argument is ignored in Microsoft Exchange.
DownloadNewMail Optional Variant True to download new mail immediately.

Remarks

Microsoft Excel logs off from any mail sessions it previously established before attempting to establish the new session.

To piggyback on the system default mail session, omit both the name and password parameters.

Example

This example logs on to the default mail account.

If IsNull(Application.MailSession) Then 
 Application.MailLogon 
End If

[!includeSupport and feedback]