Recognizing signed / encrypted messages OL2003

G

google

When I group my Inbox by Message Class, I see the expected results,
message classes such as "Message", "Out of Office Reply", "Message
(StorageQuotaWarning)", "Meeting Cancellation".

I can determine almost all of these programatically, by examining
objMsg.Class and/or obj.MsgClass. However, messages of the type "SMIME
Signed Messages" return the useless .MessageClass "IPM.Note" instead
of "IPM.Note.SMIME", which is what I would expect.

This causes my code all sorts of grief, since I can't tamper with this
class of message (remove attachements and save).

I cannot use a third party add-in, nor can I expect CDO to be
available. At this point, I just need to be able to detect this kind
of message. Is this possible in a pure VBA solution?

I've seen others have had this issue too, but have not seen an usable
answer (that I could follow at least.)

I would be most appreciative of any help I can get with this.

D.
 
E

Eric Legault [MVP - Outlook]

You'll have to use the CdoPR_MESSAGE_CLASS property with CDO to access this
message class value.

Try the sample below against an open e-mail item that's signed and note the
value of objField:

Sub GetMAPIMessageObjectFromActiveInspectorMailItem()
Dim objItem As Object
Dim objMessage As MAPI.Message
Dim objSession As New MAPI.Session
Dim objFields As MAPI.Fields, objField As MAPI.Field

If ActiveInspector Is Nothing Then Exit Sub

objSession.Logon , , , False
Set objItem = ActiveInspector.CurrentItem
Set objMessage = objSession.GetMessage(objItem.EntryID,
objItem.Parent.StoreID)
Set objFields = objMessage.Fields
Set objField = objFields.Item(CdoPR_MESSAGE_CLASS)
'objField.Value = IPM.Note.SMIME.MultipartSigned

objSession.Logoff
Set objItem = Nothing
Set objMessage = Nothing
Set objField = Nothing
Set objFields = Nothing
End Sub
 
D

Dmitry Streblechenko

I don't think there is anything you can do: Outlook always tries to be
"nice" and returns a fake unencrypted message that looks just like a normal
IPM.Note message.
Extended MAPI/CDO 1.21/third party software to be able to open the message
bypassing OOM is required.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

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