E-Mail and Excel

W

Want2Learn

The following solution addressed my requirement to use e-
mail addresses saved in an Excel spreadsheet, to create
new e-mails.

Thanks to all who helped, esp. Ron.

W2L.

---

Sub Mail_test()
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String
Dim cell As Range
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

For Each cell In Selection
If cell.Value Like "*@*" Then
strto = strto & cell.Value & ";"
End If
Next
If strto = "" Then GoTo Eind
strto = Left(strto, Len(strto) - 1)

With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Display
End With
Eind:
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
 

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