Quantcast
Channel: Active questions tagged digital-signature - Super User
Viewing all articles
Browse latest Browse all 40

Delete the digital signature from a received Outlook message

$
0
0

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 IfEnd 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.


Viewing all articles
Browse latest Browse all 40

Trending Articles