aziz rasul
Active member
- Local time
- Today, 16:50
- Joined
- Jun 26, 2000
- Messages
- 1,935
I have two email addresses in Outlook and I am trying to write code that will tell what these two email addresses are. However when I use the following code it only recognizes one email address.
Code:
Public Function OutlookAccounts() As Integer
Dim OutApp As Outlook.Application
Dim i As Long
Set OutApp = CreateObject("Outlook.Application")
For i = 1 To OutApp.Session.Accounts.Count
MsgBox OutApp.Session.Accounts.Item(i)
Next i
OutlookAccounts = i - 1
End Function