Read Mail

To read mail from Excel, use the ActivateMicrosoftApp method to start Outlook:

    Sub ReadOutlookMail( )
        Application.ActivateMicrosoftApp xlMicrosoftMail
    End Sub

For HTML-based mail systems, use the FollowHyperLink method to open the mail system’s account page:

    Sub ReadGMail( )
        ' Go to GMail.
        ThisWorkbook.FollowHyperlink ""
    End Sub

For other mail clients, use the Shell method to start the client application:

    Sub ReadEudoraMail( )
        Shell "C:\Program Files\Qualcomm\Eudora\Eudora.exe"
    End Sub

Get Programming Excel with VBA and .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.