I want to check if a mailItem with Outlook 2007 is encrypted or not.
I am pretty sure "THE" way of doing this would come from Microsofts code here.
Dim oProp As Long
oProp = CLng(Item.PropertyAccessor.GetProperty(PR_SECURITY_FLAGS))
The thing is that this code takes seconds to process and given that I am using outlook I must do it on the UI thread meaning everything is locked up.
I have tried accessing a property of the mailitem such as subject which will throw an error if the email is encrypted, but this also takes seconds to throw the error.
So is there some property, something else in the Outlook 2007 object model that will throw an exception if the mailItem is encrypted, but not lock up for seconds?
In case you are wondering what I want to do. I am trying to add a new Context button when the ItemContextMenuDisplay event is called and this button depends on whether the item is encrypted or not.