views:

468

answers:

1

Hi,

I am developing outlook 2007 add in, and facing problems with Outlook Security MessageBoxes. I know that i can disable it from the trust center and set allow programmatic access to true, but i want to disable it by code.

How can i disable Outlook Security MessageBox by code?

Note: I am using C# and VSTO.

+1  A: 

Ok,

The security guard pops up when you try to access certain properties of the mail mainly around the email addresses. You can use mapilib to stop it or use redemption's safe mail item. or

You can use the mail items PropertyAccessor to gain access to the underlying Mapi properties

For the "TO" you need PR_EMAIL_ADDRESS (or PR_SMTP_ADDRESS)

mailItem.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3003001F"); 

I would suggest that you download Dimitry's Outlook spy its "the" tool if you are developing Mapi/outlook etc.

You can then look up the Mapi properties and their ids to get the others

76mel