How to save digital signature of received mail

拟墨画扇 提交于 2019-12-11 03:07:31

问题


I am trying to save the digital signature of the currently opened mail item.

Now I realize that Outlook prevents access to encrypt/sign a new email programmatically. Here I am focused on messages which have been received.

So far, I am just able to use the MessageClass property to detect a signed email.

Function GetCurrentItem() As Object
    Dim objApp As Outlook.Application

    Set objApp = CreateObject("Outlook.Application")
    On Error Resume Next
    Select Case TypeName(objApp.ActiveWindow)
        Case "Explorer"
            Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
        Case "Inspector"
            Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
        Case Else
            ' anything else will result in an error, which is
            ' why we have the error handler above
    End Select

    Set objApp = Nothing
End Function

Sub DoExport()
    Set CurrentItem = GetCurrentItem()
    If CurrentItem.MessageClass = "IPM.Note.SMIME.MultipartSigned" Then
        MsgBox CurrentItem.MessageClass 
    End If
End Sub

回答1:


Messageclass always seems to be "IPM.Note" even on encrypted and signed mail.
I use this code to read who signed the mail.
Set PropertyAccessor = mailitem.PropertyAccessor
If PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/id/{00020328-0000-0000-C000-000000000046}/9104001f") <> "" Then
END
End If



来源:https://stackoverflow.com/questions/3299120/how-to-save-digital-signature-of-received-mail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!