bradyboyy88
Well-known Member
- Joined
- Feb 25, 2015
- Messages
- 562
My code I have creates a table from getTable method but I have recently learned there is no MAPI property to return the email addresses of these so my table columns are useless for this part. It seems the only way to do it is via the mail item object. However, I notice with my code below which uses another persons code on stackoverflow this returns a lot more information then just the email addresses. I am also not sure why this code checks to see if its an exchange user as well and this code only address recipients and actually is pretty slow.
Code:
For Each OutRecip In Session.GetItemFromID(nextRow("EntryID")).Recipients
'Debug.Print nextRow("Subject") & OutRecip.Address
Select Case OutRecip.AddressEntry.AddressEntryUserType
Case 0, 10
Set objExUser = OutRecip.AddressEntry.GetExchangeUser
If Not objExUser Is Nothing Then _
Debug.Print OutRecip.Address & objExUser.PrimarySmtpAddress '/* or copy somewhere */
Case 1
Set objExDisUser = OutRecip.AddressEntry.GetExchangeDistributionList
If Not objExDisUser Is Nothing Then _
Debug.Print objExDisUser.PrimarySmtpAddress '/* or copy somewhere */
Case Else
'/* Do nothing, recipient not recognized */
End Select
Next