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
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