如何保存已接收邮件的数字签名 [英] How to save digital signature of received mail
问题描述
我正在尝试保存当前打开的邮件项目的数字签名。
I am trying to save the digital signature of the currently opened mail item.
现在,我意识到Outlook阻止以编程方式访问加密/签名新电子邮件。
Now I realize that Outlook prevents access to encrypt/sign a new email programmatically. Here I am focused on messages which have been received.
到目前为止,我仅能够使用MessageClass属性检测签名的电子邮件。
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
推荐答案
Messageclass似乎始终是 IPM.Note,即使在经过加密和签名的邮件上也是如此。
我使用此代码读取签名邮件的人。
Set PropertyAccessor = mailitem.PropertyAccessor
如果PropertyAccessor.GetProperty( http://schemas.microsoft.com/mapi/id/{00020328-0000-0000-C000-000000000046}/9104001f )<> 然后
END
结束,如果
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
这篇关于如何保存已接收邮件的数字签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!