Link to home
Start Free TrialLog in
Avatar of jack3_99
jack3_99Flag for United States of America

asked on

Include Name with email when sending emails from Excel using CDO

I am using the CDO function in Excel to send batches of emails.  I would like to include the recipient's name in addition to their email address in the To field.

Their name is referenced by cell.Offset(0, 2).Value and their email is reference by cell.Offset(0, 3).Value.  

I receive an error if I simply concatenate the two fields together (cell.Offset(0, 2).Value & cell.Offset(0, 3).Value)

Can I include their name in the To field?  If so, what is the syntax?

Thank you in advance for any help.
Avatar of dlmille
dlmille
Flag of United States of America image

I'm checking, but I'm not sure you can do that.  You can include the sender's name.  Here's Ron's website which is all to do about sending emails from Excel (and lots of other goodies).

http://www.rondebruin.nl/cdo.htm

However, I'm testing this now:

.To = [EMAIL="Recipient's Name"]emailAddress@whatever.com[/EMAIL]


Dave
ASKER CERTIFIED SOLUTION
Avatar of dlmille
dlmille
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jack3_99

ASKER

Dave,

I appreciate your quick response.    I did have to modify it slightly to work within the rest of my code.  

.To = cell.Offset(0, 2).Value & " < " & cell.Offset(0, 3).Value & " > """

Thank you,
Jack
Right.  Looks like I put that entire formula in quotes ;)  Glad its working well for you.