VBOffice

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: 53.257  | #34
◀ Previous sample Next sample ▶
Category-Manager Category-Manager
With Category-Manager you can group your Outlook categories, share them with other users, filter a folder by category, automatically categorize new emails, and more. You can use the Addin even for IMAP.

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
Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.
email  Send a message