Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to set different signatures for replies and forwards in Outlook?

Normally, you can set different signatures for different accounts in your Outlook, but, have ever tried to apply different signatures for replies and forwards. It means, when you reply an email, the signature1 is inserted, when you forward an email the signature2 is applied. How could you solve this task in Outlook?

Set different signatures for replies and forwards with VBA code


Set different signatures for replies and forwards with VBA code

The following VBA code can help you to set different signatures for replies and forwards, please do with below steps one by one:

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Then, click Insert > Module, copy and paste below code into the opened blank module, see screenshot:

VBA code: Set different signatures for replies and forwards:

Public WithEvents GExplorer As Outlook.Explorer
Public WithEvents GMail As Outlook.MailItem
Public GFSO As Scripting.FileSystemObject
Public GTextStream As Scripting.TextStream
Public GText As String
Private Sub Application_Startup()
    Set GExplorer = Outlook.Application.ActiveExplorer
    Set GFSO = New Scripting.FileSystemObject
End Sub
Private Sub GExplorer_SelectionChange()
    Dim xItem As Object
    On Error Resume Next
    Set xItem = GExplorer.Selection.Item(1)
    If xItem.Class <> olMail Then Exit Sub
    Set GMail = xItem
End Sub
Private Sub GMail_Reply(ByVal Response As Object, Cancel As Boolean)
    InsertSignature Response, "Signature1.htm"   'change this signature name for replies
End Sub
Private Sub GMail_Forward(ByVal Forward As Object, Cancel As Boolean)
    InsertSignature Forward, " Signature2.htm"    'change this signature name for forwards
End Sub
Private Sub InsertSignature(Item As Object, SignName As String)
    Dim xSignatureFile As String
    Dim xMailItem As Outlook.MailItem
    xSignatureFile = CreateObject("WScript.Shell").SpecialFolders(5)
    xSignatureFile = xSignatureFile & "\Microsoft\Signatures\" & SignName
    Set GTextStream = GFSO.OpenTextFile(xSignatureFile)
    GText = ""
    GText = GTextStream.ReadAll
    If Item.Class <> olMail Then Exit Sub
    Set xMailItem = Item
    With xMailItem
        .Display
        .HTMLBody = .HTMLBody & "<br><br>" & GText
    End With
End Sub

Note: In the above code, Signature1 and Signature2 are the two signature names that you want to use for replying and forwarding. Please change the names to your need.

doc sig forwar reply 1

3. Still in the Microsoft Visual Basic for Applications window, click Tools > References to go to the References-Project1 dialog box, and check Microsoft Scripting Runtime option from the Available References list box, see screenshot:

doc sig forwar reply 2

4. And then click OK to close the dialog, from now on, when you reply an email, Signature1 will be inserted at once, see screenshot:

doc sig forwar reply 3

And when you forward a message, Signature2 will be inserted as following screenshot shown:

doc sig forwar reply 4


Kutools for Outlook - Brings 100 Advanced Features to Outlook, and Make Work Much Easier!

  • Auto CC/BCC by rules when sending email; Auto Forward Multiple Emails by custom; Auto Reply without exchange server, and more automatic features...
  • BCC Warning - show message when you try to reply all if your mail address is in the BCC list; Remind When Missing Attachments, and more remind features...
  • Reply (All) With All Attachments in the mail conversation; Reply Many Emails in seconds; Auto Add Greeting when reply; Add Date into subject...
  • Attachment Tools: Manage All Attachments in All Mails, Auto Detach, Compress All, Rename All, Save All... Quick Report, Count Selected Mails...
  • Powerful Junk Emails by custom; Remove Duplicate Mails and Contacts... Enable you to do smarter, faster and better in Outlook.
shot kutools outlook kutools tab 1180x121
shot kutools outlook kutools plus tab 1180x121
 
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.