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?
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.
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:
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:
And when you forward a message, Signature2 will be inserted as following screenshot shown:
Kutools for Outlook
More than 100 Advanced Functions for Outlook 2010, 2013, 2016, 2019 and 365