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 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 in to the default mail account.

Visual Basic for Applications
If IsNull(Application.MailSession) Then Application.MailLogon End If
Establish connection with MS Exchange? mail logon Mail Logon Method MailLogon MailLogon Method Procedure for logging onto MS Mail? Start mail session?

See also: