1

I've tried different approaches but I could not find a way to determine the sender address reliable from Outlook 2007 up to Outlook 2013 when multiple accounts can be selected in Outlook.

My addin is build on Add-In Express.

The aim is to get the account sender address from an active new mailitem (active mailinspector).

inspector = (AddinModule.CurrentInstance.OutlookApp as Outlook.Application).ActiveInspector();
mailitem = inspector.CurrentItem as Outlook.MailItem;

In Outlook 2013 it is possible to use:

mailitem.SendUsingAccount.CurrentUser.AddressEntry.Address

What can I do to get the sender address when my add-in is running on Outlook 2010 or 2007?

aDoubleSo
  • 1,128
  • 9
  • 19

1 Answers1

2

SendUsingAccount was added in Outlook 2007, so you should be good. I am not sure why you would want to use mailitem.SendUsingAccount.CurrentUser.AddressEntry.Address - you will always get the address of the default Outlook account. Have you tried to use mailitem.SendUsingAccount.SmtpAddress?

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78