我正在尝试保存当前打开的邮件项目的数字签名。
现在我意识到 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