ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Send multiple email in Excel (https://www.excelbanter.com/excel-discussion-misc-queries/115153-send-multiple-email-excel.html)

Appache

Send multiple email in Excel
 
I have a column named e-mails in excel that e-mail addresses accommodate in
that column. What I want to do is to send an email to selected email
addresses via outlook. I want outlook to be opened and all the selected email
addresses are placed in the to: field in outlook. Is there any way to do that?

--
Thanks

Ron de Bruin

Send multiple email in Excel
 
Hi Appache

You can do it with a macro if you want

Sub Mail_small_Text_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim cell As Range
Dim strto As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"

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

With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
.display
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
I have a column named e-mails in excel that e-mail addresses accommodate in
that column. What I want to do is to send an email to selected email
addresses via outlook. I want outlook to be opened and all the selected email
addresses are placed in the to: field in outlook. Is there any way to do that?

--
Thanks




Appache

Send multiple email in Excel
 
I assign the macro to a button but it gives an error which is "Cant execute
code in break mode" on the line of Set OutApp =
CreateObject("Outlook.Application")

I dont know what the break mode is? Do you have any idea what is that?

--
Thanks


"Ron de Bruin" wrote:

Hi Appache

You can do it with a macro if you want

Sub Mail_small_Text_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim cell As Range
Dim strto As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"

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

With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
.display
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
I have a column named e-mails in excel that e-mail addresses accommodate in
that column. What I want to do is to send an email to selected email
addresses via outlook. I want outlook to be opened and all the selected email
addresses are placed in the to: field in outlook. Is there any way to do that?

--
Thanks





Ron de Bruin

Send multiple email in Excel
 
Do you use Outlook or Outlook Express?

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
I assign the macro to a button but it gives an error which is "Cant execute
code in break mode" on the line of Set OutApp =
CreateObject("Outlook.Application")

I dont know what the break mode is? Do you have any idea what is that?

--
Thanks


"Ron de Bruin" wrote:

Hi Appache

You can do it with a macro if you want

Sub Mail_small_Text_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim cell As Range
Dim strto As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"

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

With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
.display
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
I have a column named e-mails in excel that e-mail addresses accommodate in
that column. What I want to do is to send an email to selected email
addresses via outlook. I want outlook to be opened and all the selected email
addresses are placed in the to: field in outlook. Is there any way to do that?

--
Thanks







Appache

Send multiple email in Excel
 
Yes I do
--
Thanks


"Ron de Bruin" wrote:

Do you use Outlook or Outlook Express?

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
I assign the macro to a button but it gives an error which is "Cant execute
code in break mode" on the line of Set OutApp =
CreateObject("Outlook.Application")

I dont know what the break mode is? Do you have any idea what is that?

--
Thanks


"Ron de Bruin" wrote:

Hi Appache

You can do it with a macro if you want

Sub Mail_small_Text_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim cell As Range
Dim strto As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"

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

With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
.display
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
I have a column named e-mails in excel that e-mail addresses accommodate in
that column. What I want to do is to send an email to selected email
addresses via outlook. I want outlook to be opened and all the selected email
addresses are placed in the to: field in outlook. Is there any way to do that?

--
Thanks







Ron de Bruin

Send multiple email in Excel
 
Do you have missing references in ToolsReferences in the VBA editor

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
Yes I do
--
Thanks


"Ron de Bruin" wrote:

Do you use Outlook or Outlook Express?

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
I assign the macro to a button but it gives an error which is "Cant execute
code in break mode" on the line of Set OutApp =
CreateObject("Outlook.Application")

I dont know what the break mode is? Do you have any idea what is that?

--
Thanks


"Ron de Bruin" wrote:

Hi Appache

You can do it with a macro if you want

Sub Mail_small_Text_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim cell As Range
Dim strto As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"

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

With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
.display
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
I have a column named e-mails in excel that e-mail addresses accommodate in
that column. What I want to do is to send an email to selected email
addresses via outlook. I want outlook to be opened and all the selected email
addresses are placed in the to: field in outlook. Is there any way to do that?

--
Thanks









Appache

Send multiple email in Excel
 
I fixed it thank you..
--
Thanks


"Ron de Bruin" wrote:

Do you have missing references in ToolsReferences in the VBA editor

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
Yes I do
--
Thanks


"Ron de Bruin" wrote:

Do you use Outlook or Outlook Express?

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
I assign the macro to a button but it gives an error which is "Cant execute
code in break mode" on the line of Set OutApp =
CreateObject("Outlook.Application")

I dont know what the break mode is? Do you have any idea what is that?

--
Thanks


"Ron de Bruin" wrote:

Hi Appache

You can do it with a macro if you want

Sub Mail_small_Text_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim cell As Range
Dim strto As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"

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

With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
.display
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Appache" wrote in message ...
I have a column named e-mails in excel that e-mail addresses accommodate in
that column. What I want to do is to send an email to selected email
addresses via outlook. I want outlook to be opened and all the selected email
addresses are placed in the to: field in outlook. Is there any way to do that?

--
Thanks











All times are GMT +1. The time now is 03:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com