
Finding the correct email address
I've written some code in Excel
VBA that collects some data, composes and
sends an email to an address typed into a worksheet cell. It works well if I
type in the entire email address however if I just type in the name I get
the following error messge:
"Outlook does not recognize one or more names"
How can I get Outlook to find the right name or at least present me with the
opportunity to point in in the right direction?
Cell A5 is named recipeint and will only work if it contains
Const olmailitem = 0
Set objMail = OutlookApp.createitem(olmailitem)
With objMail
.Subject = subj
.body = bodytext
.to = Range("Recipient")
.Send
End With