Get the email address of the current user in Outlook 2007

electricsheep picture electricsheep · Jan 21, 2011 · Viewed 22.9k times · Source

I have an Outlook add in written in C#.

I was wondering how or if I could get the email address of the current user?

Thanks

Answer

Lee Grissom picture Lee Grissom · May 12, 2012

Tested in VS 2010, .NET 4.0, Outlook 2010:

var emailAddress = this.Application.ActiveExplorer().Session.CurrentUser.AddressEntry.GetExchangeUser().PrimarySmtpAddress;