title: How to save digital signature of received mail
body: <p>I am trying to save the digital signature of the currently opened mail item.</p>
  
  <p>Now I realize that Outlook prevents access to encrypt/sign a new email programmatically. Here I am focused on messages which have been received.</p>
  
  <p>So far, I am just able to use the MessageClass property to detect a signed email.</p>
  
  <pre><code>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
  </code></pre>