4

My goal is to delete the digital signature in an Outlook message. My initial idea was to create a VBA script (which I have done below) to enumerate all attachments in the selected mail item and remove the digital signature attachment when it is encountered.

Unfortunately, the digital signature is not showing up as one of the message's attachments. Maybe I am confused... I thought that digital signatures were actually attachments.

Public Sub DeleteDigitalSignatureAttachment()
    Dim olkMsg As MailItem
    Select Case TypeName(Application.ActiveWindow)
        Case "Explorer"
            Set olkMsg = Application.ActiveExplorer.Selection(1)
        Case "Inspector"
            Set olkMsg = Application.ActiveInspector.CurrentItem
    End Select
    If olkMsg.Attachments.Count > 0 Then
        Dim s As String
        For i = 1 To olkMsg.Attachments.Count
            s = s & olkMsg.Attachments.Item(i).FileName & ", "
            'olkMsg.Attachments.Remove (i)
        Next i
        MsgBox (s)
    End If
End Sub

Note that in the above code, I already considered that I could be "skipping" the digital signature by having my "For loop" begin at index 1 instead of 0. However, it needs to be this way because trying to access .Attachments.Item(0) results in an out-of-bounds error.

4
  • The digital signature, AFAIK, is not an attachment as such. I'm not sure Outlook gives you any access to it. The whole purpose of the ds is to validate that the message has not been tampered with. You would need access to the raw message and Outlook hides that from you. May 11, 2015 at 21:10
  • Why? What are you trying to accomplish? May 13, 2015 at 18:34
  • 1
    The purpose of deleting digital signatures is because I have thousands of old digitally-signed messages that I have received over the years from people whose digital certificates are now expired. It takes a long time for Outlook to open messages that are signed by expired certificates due to an Outlook plugin that verifies signatures.
    – Lakey
    May 13, 2015 at 19:54
  • It might be a property of mailitem here that you can remove. I know adding it via VBA isn't possible, so I'm not sure about removing it. May 14, 2015 at 13:44

1 Answer 1

0

You should be able to force outlook to view the mail as plain text per relevant KB. Check there for the setting location and note this part -

In the case where digital signatures are used, Outlook must display the e-mail message in the original format that is specified by the sender, or you must turn on the Read all digitally signed mail in plain text option. To turn on the Read all digitally signed mail in plain text option, click to select the Read all digitally signed mail in plain text check box under the Read all standard mail in plain text option.

2
  • Thank you for attempting to solve my question. Unfortunately, having the message displayed in plain text does not solve the problem. (This option was already turned on for my Outlook client)
    – Lakey
    May 14, 2015 at 13:30
  • I imagined it would ignore the signature as plain text, at least that's what I thought, sorry. May 14, 2015 at 13:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .