Looking for Outlook macro to Copy Recipient Names into Email Body

Status
Not open for further replies.

Aussie

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2010
All,

Nice forum ... I am somewhat a newbie ... and I like writing VBA :)

I searched but could not find any VBA to allow me to Copy an email's Recipient Names into the introductory line of the Email Body.

So, for example, when I have added email addresses to the "To:" line:
To: lsywalker@outlook.com, dmaul@outlook.com

I would like to run a macro that adds a line like this to the first line in the body of the email. That is, extract the first names for each contact from the contact list and concatenate them:
Dear Luke, Darth,

And then complete the rest of the body text manually?

Can this be done? Can someone please point me in the right direction (e.g., sample code snippet)

Thanks in advance.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
If you are doing a mail merge or are picking up the address from a contact you can insert the contact name. I have samples that do this. If you are just replying, you could use the person's display name (not always the best idea because it might be in last, first order).

Looking up a contact is doable but I'm not sure if i have any code samples that show how.

you'd use something like
Set oContact = colItems.Find("[FullName] = '" & sSenderName & "'")
If Not (oContact Is Nothing) Then
' use something else for the introduction
else
' get the name from the found contact
ocontact.fullname
end if

(the Find snippet is from http://www.slipstick.com/developer/create-contacts-from-messages/ - which checks for contacts before creating one for the sender of a message)
 

Aussie

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2010
Diane ... thanks for the starter code ... I'll see what I can do ...
 

KoolPal

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
I've been hunting for this for a long time with no luck! Perhaps now I'll get the solution!!
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
B Looking for Outlook 2013 update for Send Drafts Macro Using Outlook 4
C Looking for feedback on new Outlook Add-in Using Outlook 0
D Looking to move away from exchange to outlook.com Using Outlook 4
O looking to bring in all my folders from Outlook Express (XP) to Outlook 2013 Using Outlook 3
R Outlook Template: Looking to distribute a VBA Outlook template to other people Using Outlook 1
Q Looking for Outlook 2010 Close Event Id Exchange Server Administration 1
S Looking for client-side method (Outlook 2007/Exchange 2007) for users to delete Outlook VBA and Custom Forms 2
P Outlook looking for Copy of Outlook.pst Outlook VBA and Custom Forms 1
sophievldn Looking for a macro that moves completed items from subfolders to other subfolder Outlook VBA and Custom Forms 7
B Looking to get the Recipient email address (or even the "friendly name") from an email I am replying to using VBA Outlook VBA and Custom Forms 4
B Looking to filter (or just find/search) for only messages that the sender has sent more than 1 messa Using Outlook 2
G Looking for help with our Organization Forms Library Outlook VBA and Custom Forms 1
peacepanda How to save attachment looking at the attachment name Outlook VBA and Custom Forms 1
M Looking for options and best practices for an Edge Server (Exchange or not) Exchange Server Administration 0
M Looking for trainer in Business Contact Manager BCM (Business Contact Manager) 0
B Looking for an add-in or a way to send automatic replies based off a list Using Outlook 2
J Looking for a solution (maybe an add-in) to easily track email conversations Using Outlook 3
I Looking for a productivity add-in similar to "Nostalgy" for Thunderbird Using Outlook 5
C Looking for way to tie a Business Contact to more than one Account BCM (Business Contact Manager) 5
J OL2003 Macro disables itself - looking for way to automate 'enable' Using Outlook 2
R Looking for my BCM backup files BCM (Business Contact Manager) 1
B Looking for email address under ItemSend event Outlook VBA and Custom Forms 6
S Looking for a Utility for Editting An Exported Rules (.rwz) File Using Outlook 6
U looking for feedback on installation process and on eMarking Assis Outlook VBA and Custom Forms 1
petunia Outlook tasks module sunsetting? Exchange Server Administration 3
G Save emails as msg file from Outlook Web AddIn (Office JS) Outlook VBA and Custom Forms 1
D Outlook VBA forward the selected email to the original sender’s email ID (including the email used in TO, CC Field) from the email chain Outlook VBA and Custom Forms 3
U Outlook 2021 not showing contact cards in Searches Using Outlook 2
C Outlook - Macro to block senders domain - Macro Fix Outlook VBA and Custom Forms 2
H Outlook 365 O365 outlook calendar item editing Using Outlook 1
J Outlook 365 html inline images Using Outlook 1
Rupert Dragwater How to get Outlook 365 to open from websites Using Outlook 5
S Why do I have to close and reopen Outlook for macros to work? Outlook VBA and Custom Forms 2
J Outlook 2021 ScanPST errors (yet again ... sorry): repair button missing Outlook 2021 Using Outlook 0
HarvMan Outlook 365 - Rule to Move an Incoming Message to Another Folder Using Outlook 4
K Moved pst to new computer, now Gmail not coming into Outlook Using Outlook 7
S Email Macros to go to a SHARED Outlook mailbox Draft folder...NOT my personal Outlook Draft folder Using Outlook 2
F Running Scripts in Outlook 2021 Using Outlook 0
Nufc1980 Outlook "Please treat this as private label" auto added to some emails - Help. Using Outlook 3
S Outlook 2019 Custom outlook Add-in using Visual Studio Outlook VBA and Custom Forms 0
V Outlook macros no longer run until VB editor is opened Outlook VBA and Custom Forms 0
R Outlook 365 How to integrate a third-party app with Outlook to track email and sms? Using Outlook 2
e_a_g_l_e_p_i I can't believe what I am seeing when trying to install Outlook 2021 Using Outlook 9
Kika Melo Outlook Calendar deleted appointments not in Deleted Items folder Using Outlook 3
P How to get a QR code for automatic signin with Outlook for iOS Using Outlook 5
J Migrating Outlook Using Outlook 1
Retired Geek Outlook for the MAC with Yahoo accounts now very broken Using Outlook 9
S Outlook 2002- "Send" button has disappeared. Help please. Using Outlook 1
L How Stop Outlook Nag Messages Using Outlook 1
TomHuckstep Remove Send/Receive All Folders (IMAP/POP) button from Outlook 365 Ribbon Using Outlook 1

Similar threads

Top