Skip to main content

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

Author: Xiaoyang Last Modified: 2018-08-20

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


Best Office Productivity Tools

Breaking News: Kutools for Outlook Launches Free Version!

Experience the all-new Kutools for Outlook FREE version with 70+ incredible features, yours to use FOREVER! Click to download now!

πŸ€– Kutools AI : Instant pro emails with AI magic--one-click to genius replies, perfect tone, multilingual mastery. Transform emailing effortlessly! ...

πŸ“§ Email Automation: Auto Reply (Available for POP and IMAP)  /  Schedule Send Emails  /  Auto CC/BCC by Rules When Sending Email  /  Auto Forward (Advanced Rules)   /  Auto Add Greeting   /  Automatically Split Multi-Recipient Emails into Individual Messages ...

πŸ“¨ Email Management: Recall Emails  /  Block Scam Emails by Subjects and Others  /  Delete Duplicate Emails  /  Advanced Search  /  Consolidate Folders ...

πŸ“ Attachments ProBatch Save  /  Batch Detach  /  Batch Compress  /  Auto Save   /  Auto Detach  /  Auto Compress ...

🌟 Interface Magic: 😊More Pretty and Cool Emojis   /  Remind you when important emails come  /  Minimize Outlook Instead of Closing ...

πŸ‘ One-click Wonders: Reply All with Incoming Attachments  /   Anti-Phishing Emails  /  πŸ•˜Show Sender's Time Zone ...

πŸ‘©πŸΌβ€πŸ€β€πŸ‘©πŸ» Contacts & Calendar: Batch Add Contacts From Selected Emails  /  Split a Contact Group to Individual Groups  /  Remove Birthday Reminders ...

Instantly unlock Kutools for Outlook with a single clickβ€”permanently free. Don't wait, download now and boost your efficiency!

kutools for outlook features1 kutools for outlook features2
 

 

 

Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations