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 auto create a dear sender’s name when replying message in Outlook?

When replying email message, you should type the sender’s name and greetings manually. To save time and improve work efficiency, you may consider creating a dear sender’s name and greetings automatically in Outlook. This article, I will talk about some useful methods for solving this task in Outlook.

Create a dear sender’s name and greetings automatically when replying message with VBA code

Create a dear sender’s name and greetings automatically when replying message with Kutools for Outlook


Create a dear sender’s name and greetings automatically when replying message:

To insert the dear sender's name and greetings automatically when replying a message, the Kutools for Outlook's Add greeting when reply feature can help you finish this job quickly and easily in Outlook.

doc auto dear sender name 6

Kutools for Outlook: with more than 20+ handy Excel add-ins, free to try with no limitation in 60 days. Download and try the free trial now!

Create a dear sender’s name and greetings automatically when replying message with VBA code

The following VBA code can help you to auto insert a dear sender’s name and greetings when replying an email message, please do as this:

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

2. In the Microsoft Visual Basic for Applications window, double click ThisOutlookSession from the Project1(VbaProject.OTM) pane to open the mode, and then copy and paste the following code into the blank module.

VBA code: Auto insert a dear sender’s name and greetings when replying:

Public WithEvents GExplorer As Outlook.Explorer
Public WithEvents GMailItem As Outlook.MailItem
Private Sub Application_Startup()
    Set GExplorer = Outlook.Application.ActiveExplorer
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 GMailItem = xItem
End Sub
Private Sub GMailItem_Reply(ByVal Response As Object, Cancel As Boolean)
    AutoAddGreetingToReply Response
End Sub
Private Sub GMailItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
    AutoAddGreetingToReply Response
End Sub
Sub AutoAddGreetingToReply(Item As Object)
    Dim xGreetStr As String
    Dim xReplyMail As MailItem
    Dim xSenderName As String
    Dim xRecipient As Recipient
    On Error Resume Next
    If Item.Class <> olMail Then Exit Sub
    Set xReplyMail = Item
    For Each xRecipient In xReplyMail.Recipients
        If xSenderName = "" Then
            xSenderName = xRecipient.Name
        Else
            xSenderName = xSenderName & "," & xRecipient.Name
        End If
    Next xRecipient
    Select Case Time
           Case 0.3 To 0.5
                xGreetStr = " Good morning!"
           Case 0.5 To 0.75
                xGreetStr = " Good afternoon!"
           Case Else
                xGreetStr = " Good evening!"
    End Select
    With xReplyMail
        .Display
        .HTMLBody = "<HTML><Body>Dear " & xSenderName & ",</HTML></Body>" & xGreetStr & .HTMLBody
    End With
End Sub

doc auto dear sender name 1

3. Then close the Outlook and restart it to take the code effect, and now, when you reply an email message, a dear sender’s name and greetings are inserted into the body automatically, see screenshot:

doc auto dear sender name 2


Create a dear sender’s name and greetings automatically when replying message with Kutools for Outlook

If you have Kutools for Outlook, with its Add greeting when reply feature, Outlook will auto insert the sender’s name when replying.

Kutools for Outlook : with more than 20 handy Outlook add-ins, free to try with no limitation in 60 days. 

After installing Kutools for Outlook, please do as this:

1. Click Kutools > Options, see screenshot:

doc auto dear sender name 3

2. In the Options dialog box, under the Reply tab, check Add greeting when reply option, and then enter the greetings as you need, see screenshot:

doc auto dear sender name 4

3. Then click OK to finish this setting, from now on, when replying a message, the greetings will be created automatically in front of the message body, see screenshot:

doc auto dear sender name 5

Click to download Kutools for Outlook and free trial now!


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.