Automatically creating a Dear *sender's name*, in Outlook

5

1

I would like to automate the process of creating the first part of an email, namely "Dear sender's name" in Outlook. I believe it is possible as the name can be derived from the name field of the person who has sent the email (i.e. name field [ email field ] which appears at the top of the email) . How do I go about accomplishing this?

Ang Zhi Ping

Posted 2011-07-25T09:20:27.537

Reputation: 151

1Do you mean when a new e-mail arrives from someone you don't know, and you hit reply? You want it to extract the person's e-mail address and then add "Dear sender's name" to the reply? – KCotreau – 2011-07-25T11:37:19.160

Answers

3

This is a Mail Merge feature and the Microsoft Outlook blog runs through how to set that up

The basic steps to creating a mail merged e-mail from Outlook are:

  1. Select your contacts in Outlook
  2. Select to send an e-mail in the Mail Merge dialog and choose your subject
  3. Compose your e-mail in Word – inserting fields where appropriate
  4. Preview and Send

Read about the details on the blog article linked above.

admintech

Posted 2011-07-25T09:20:27.537

Reputation: 6 970

3Please don't just post a link, if you do the answer becomes worthless if the link expires. – Nifle – 2011-07-25T12:03:25.180

1@Nifle sorry about that – admintech – 2011-07-25T12:46:48.693

2

Sub InsertNameInReply()

Dim Msg As Outlook.MailItem
Dim MsgReply As Outlook.MailItem
Dim strGreetName As String
Dim lGreetType As Long

 ' set reference to open/selected mail item
On Error Resume Next
Select Case TypeName(Application.ActiveWindow)
Case "Explorer"
    Set Msg = ActiveExplorer.Selection.Item(1)
Case "Inspector"
    Set Msg = ActiveInspector.CurrentItem
Case Else
End Select
On Error GoTo 0

If Msg Is Nothing Then GoTo ExitProc

strGreetName = Mid$(Msg.SenderName, 2 + InStr(1, Msg.SenderName, ", ", Len(Msg.SenderName)) - 1)

Set MsgReply = Msg.Reply

With MsgReply
    .Subject = "RE:" & Msg.Subject
    .HTMLBody = "<span style=""font-family : verdana;font-size : 10pt""><p>Hello " & strGreetName & ",</p></span>" & .HTMLBody
    .Display
End With

ExitProc:
Set Msg = Nothing
Set MsgReply = Nothing
End Sub

padma sri

Posted 2011-07-25T09:20:27.537

Reputation: 59

Your answer would be even better if you provided a bit of explanation. We want to teach others here how to fish for life, not just feed them for a day. – I say Reinstate Monica – 2018-02-09T23:16:45.087