_Application.MailLogon Method

Logs in 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.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Sub MailLogon ( _
    Name As Object, _
    Password As Object, _
    DownloadNewMail As Object _
)
'Usage
Dim instance As _Application
Dim Name As Object
Dim Password As Object
Dim DownloadNewMail As Object

instance.MailLogon(Name, Password, DownloadNewMail)
void MailLogon(
    Object Name,
    Object Password,
    Object DownloadNewMail
)

Parameters

  • Name
    Type: System.Object

    Optional Object. The mail account name or Microsoft Exchange profile name. If this argument is omitted, the default mail account name is used.

  • Password
    Type: System.Object

    Optional Object. The mail account password. This argument is ignored in Microsoft Exchange.

  • DownloadNewMail
    Type: System.Object

    Optional Object. 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.

See Also

Reference

_Application Interface

_Application Members

Microsoft.Office.Interop.Excel Namespace