如何保存收到邮件的数字签名

发布于 2024-09-10 10:53:34 字数 920 浏览 6 评论 0原文

我正在尝试保存当前打开的邮件项目的数字签名。

现在我意识到 Outlook 阻止以编程方式加密/签署新电子邮件。在这里,我重点关注已收到的消息。

到目前为止,我只能使用 MessageClass 属性来检测签名的电子邮件。

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

意中人 2024-09-17 10:53:34

即使在加密和签名的邮件上,消息类似乎始终是“IPM.Note”。
我使用此代码来读取谁签署了邮件。
设置 PropertyAccessor = mailitem.PropertyAccessor
如果 PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/id/{00020328-0000-0000-C000-000000000046}/9104001f") <> ”“那么
结束
结束如果

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文