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:
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. 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
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:
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:
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:
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:
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.


You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Be the first to comment.