Checking attributes of MailItem

  • Thread starter Marcin Domaslawski
  • Start date
M

Marcin Domaslawski

Hi,

I'm creating Add-in to outlook (C#). I'm capturing
ApplicationEvents_11_ItemSendEventHandler event. In this event I would
like to check some attributes of email message e.g. "To" field.
Problem is, when I try to get value of an attribute, appears security
releated dialog that some program tries to send email by Outlook.
In short my code:
Outlook.MailItem miMailItem = (Outlook.MailItem) Item;
Outlook.MailItem workIMailItem = null ;
workIMailItem = (Outlook.MailItem) micMailItem.Copy(); // tried to
copy to local variable but changed nothing
String strTo = workIMailItem.To.ToString(); //
appears security dialog

I think I'm doing something wrong. How to avoid that security dialog ?
 
K

Ken Slovak - [MVP - Outlook]

Derive all of your Outlook objects from the Application object passed to you
in your startup handler. That's trusted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top