Determining in VBA if an Outlook 2003 mail item has been digitally signed
Posted on 2007-07-25
I have VBA code in an Excel 2003 macro which reads through my Outlook 2003 Inbox that looks like this...
Set oolFolder = ns.GetDefaultFolder(olFolderInbox)
For Each oolItem In oolFolder.Items
If oolItem.Class = olMail Then
Set oolMailItem = oolItem ...
"oolItem" is defined as an Object, since there appears to be no generic "Item" definition.
This code works fine until I get to a piece of mail that has been digitally signed. When it attempts to set oolMailItem to oolItem, it gets a "Type mismatch". This only happens on digitally signed mail items.
I cannot seem to find a way to determine that a piece of mail has been signed so that I can skip processing the email. I can't find a property or method that would give me the information.
I use Windows XP Pro SP2.