2

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

现在我意识到 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
4

1 回答 1

0

即使在加密和签名的邮件上,Messageclass 似乎也总是“IPM.Note”。
我使用此代码来读取谁签署了邮件。
Set PropertyAccessor = mailitem.PropertyAccessor
If PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/id/{00020328-0000-0000-C000-000000000046}/9104001f") <> "" Then
END
End If

于 2013-10-16T15:23:14.217 回答