Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the email address of the current user in Outlook 2007

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

like image 938
electricsheep Avatar asked Jan 21 '11 16:01

electricsheep


1 Answers

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

var emailAddress = this.Application.ActiveExplorer().Session.CurrentUser.AddressEntry.GetExchangeUser().PrimarySmtpAddress;
like image 102
Lee Grissom Avatar answered Oct 02 '22 20:10

Lee Grissom