I am trying to create Outlook Addin using C# by Customizing Application_ItemSend event of the Send button.
I need All the email details before sending an email.
When i run the below code @ my home i get proper results by putting some personal email id its working.
But when i run this similar code in office outlook machine i get the names.
As by default outlook's check names code is enabled, this returns first and last name.
I am using Outlook 2010 @ both the places. Office outlook is mapped to office active directory. my home outlook is not mapped. Can anyone provide a common solution which will give me all the email address used(to, cc, bcc & from) irrespective of active directory mapped or not.
private void ThisAddIn_Startup(object sender, System.EventArgs e) {
Application.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
}
void Application_ItemSend(object Item, ref bool Cancel) {
Outlook.MailItem mail = Item as Outlook.MailItem;
Outlook.Inspector inspector = Item as Outlook.Inspector;
System.Windows.Forms.MessageBox.Show(mail.CC);
System.Windows.Forms.MessageBox.Show(mail.BCC);
}