Get the Default Email Account

A VBA macro that tells you which of all the available email accounts is the default one.

Last modified: 2006/11/09 | Accessed: 26.198  | #34
◀ Previous sample Next sample ▶
Category-Manager Category-Manager
Access the master category list in the blink of an eye, share your color categories in a network, get a reminder service, and more.

This small sample demonstrates how to get the default account with the Redemption.

tip  How to add macros to Outlook
Public Function GetDefaultMailAccount() As String
  Dim Session As Redemption.RDOSession
  Dim List As Redemption.RDOAccountOrderList

  Set Session = CreateObject("redemption.rdosession")
  Session.LogOn ""

  ' The first object of the sorted list is always the default account
  Set List = Session.Accounts.GetOrder(acMail)
  GetDefaultMailAccount = List.Item(1).Name
End Function
ReplyAll ReplyAll
ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the e-mail.
email  Send a message