More Questions on Using E-mail Addresses from Excel

W

Want2Learn

I posted earlier asking if anyone knew how to use e-mail
addresses in an Excel spreadsheet and someone kindly
responded by saying go to this site:

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

I looked there but cannot see the option I want. I do not
want to send a sheet, or range or book. I want to use the
e-mail addresses in a range to address a new e-mail, in
Outlook.

Can it be done?
 
B

Bob Phillips

Dim objOutlook As Object
Dim objMailItem As Object
Dim objRecipient As Object
Dim objNameSpace As Object

Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNameSpace("MAPI")
objNameSpace.Logon , , True

Set objMailItem = objOutlook.CreateItem(0)
Set objRecipient =
objMailItem.Recipients.Add(ActiveSheet.Range("A1"))
objRecipient.Type = 1 'To
objMailItem.Subject = "This is my message"
objMailItem.Body = "Text messages here"
objMailItem.Attachments.Add (Filename) 'you only tneed this
if

'you are sending attachments?
objMailItem.Send

if you want to show the mail rather than automatically sending it, change
the last line to

objMailItem.display
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top