Email remove outlook default message (1 Viewer)

Del Bloke

New member
Local time
Today, 10:55
Joined
Jan 13, 2014
Messages
2
Hi,

I have created a form that allows the user to create an Outlook email message using a saved HTML template in VBA but the users default Outlook signature is added every time the message is sent.

Has anyone any suggestions on how to remove the default signature from the message body?
 

GSSDevelopment

PHP Guru
Local time
Today, 05:55
Joined
Dec 31, 2012
Messages
58
Hi,

I have created a form that allows the user to create an Outlook email message using a saved HTML template in VBA but the users default Outlook signature is added every time the message is sent.

Has anyone any suggestions on how to remove the default signature from the message body?
The auto-insert signature is stored in the hidden Word bookmark called _MailAutoSig

Code:
Sub DeleteSig(msg As Outlook.MailItem)
    Dim objDoc As Word.Document
    Dim objBkm As Word.Bookmark
    On Error Resume Next
    Set objDoc = msg.GetInspector.WordEditor
    Set objBkm = objDoc.Bookmarks("_MailAutoSig")
    If Not objBkm Is Nothing Then
        objBkm.Select
        objDoc.Windows(1).Selection.Delete
    End If
    Set objDoc = Nothing
    Set objBkm = Nothing
End Sub

Source

Cheers
 

Del Bloke

New member
Local time
Today, 10:55
Joined
Jan 13, 2014
Messages
2
Thanks GSSDevelopment, it works a treat.

I also had to add Word in tools/references of VBA and then Call DeleteSig(msg) after displaying the item.

Many thanks
 

MS16

New member
Local time
Today, 05:55
Joined
Apr 6, 2016
Messages
1
Hi,

I'm very new to using Visual Basic for Outlook 2010. I am trying to create a .oft file that automatically deletes the signature so that the body of the email is blank. Would you know the code I would use to do that in the Visual Basic editor?

Thanks,

Mark
 

Users who are viewing this thread

Top Bottom