Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default E-mail to a list in worksheet

Is there an easy way to send e-mail to a list of addresses I have in
an
Excel worksheet? I'm fairly proficient in VBA.

TIA

Ed



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default E-mail to a list in worksheet

Hi Ed

Outlook or Outlook Express ?
Body or Attachment ?
Personalize or one basic mail to all ?

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



"Ed" wrote in message ...
Is there an easy way to send e-mail to a list of addresses I have in an
Excel worksheet? I'm fairly proficient in VBA.

TIA

Ed




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default E-mail to a list in worksheet

Hi Ron,


My data, a club membership list, is in an Excel worksheet. I normally
use Outlook for reading/sending
e-mail, but have no reason to avoid using OE for this particular task.

We normally communicate with our members by snail-mail, but sometimes
need to get something
out to them quickly. Typically, this would be the same short note to
all members. I would prefer it to be in the body
so people don't have to do an additional step. Also, some people have
their spam filtering
set up to reject attachments.

Thanks for your interest.

Ed


"Ron de Bruin" wrote in message
...
Hi Ed

Outlook or Outlook Express ?
Body or Attachment ?
Personalize or one basic mail to all ?

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



"Ed" wrote in message
...
Is there an easy way to send e-mail to a list of addresses I have
in an
Excel worksheet? I'm fairly proficient in VBA.

TIA

Ed








  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default E-mail to a list in worksheet

Hi Ed

Try this example

http://www.rondebruin.nl/mail/folder3/smallmessage.htm
If you use Example 2 you can add the text in a text file

Change the To line to .To = strto

And add the code below to the macro to send to all the addresses in Column C in "Sheet1"

Dim cell As Range
Dim strto As String
For Each cell In ThisWorkbook.Sheets("Sheet1") _
.Columns("C").Cells.SpecialCells(xlCellTypeConstan ts)
If cell.Value Like "?*@?*.?*" Then
strto = strto & cell.Value & ";"
End If
Next
strto = Left(strto, Len(strto) - 1)



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



"Ed" wrote in message ...
Hi Ron,


My data, a club membership list, is in an Excel worksheet. I normally use Outlook for reading/sending
e-mail, but have no reason to avoid using OE for this particular task.

We normally communicate with our members by snail-mail, but sometimes need to get something
out to them quickly. Typically, this would be the same short note to all members. I would prefer it to be in the body
so people don't have to do an additional step. Also, some people have their spam filtering
set up to reject attachments.

Thanks for your interest.

Ed


"Ron de Bruin" wrote in message ...
Hi Ed

Outlook or Outlook Express ?
Body or Attachment ?
Personalize or one basic mail to all ?

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



"Ed" wrote in message ...
Is there an easy way to send e-mail to a list of addresses I have in an
Excel worksheet? I'm fairly proficient in VBA.

TIA

Ed










  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default E-mail to a list in worksheet

Ron,

Thanks!

That sets up the message in an Outlook message. I then have to click
on the Send manually. Can I
automate that final step? I wouldn't mind doing it manually if I
wanted to but all recipients in
the same message. However, since there will be about 150 addresses I'm
a little afraid
it will be treated as Spam by someone along the way.... or I might
even be fingered as a spammer
and get put on a blackhole list! If I can automate the send I could
put it in a loop and send out
15 messages each to 10 people. What do you think?

Ed

"Ron de Bruin" wrote in message
...
Hi Ed

Try this example

http://www.rondebruin.nl/mail/folder3/smallmessage.htm
If you use Example 2 you can add the text in a text file

Change the To line to .To = strto

And add the code below to the macro to send to all the addresses in
Column C in "Sheet1"

Dim cell As Range
Dim strto As String
For Each cell In ThisWorkbook.Sheets("Sheet1") _
.Columns("C").Cells.SpecialCells(xlCellTypeConstan ts)
If cell.Value Like "?*@?*.?*" Then
strto = strto & cell.Value & ";"
End If
Next
strto = Left(strto, Len(strto) - 1)



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







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default E-mail to a list in worksheet

Oops

I update almost all pages yesterday and forgot to change it on this page to
..Send

Try this one you can change Send to Display to test it

Sub Mail_small_Text_Outlook()
' Is working in Office 2000-2007
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim cell As Range
Dim strto As String
Dim I As Integer


Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon

For I = 1 To 150 Step 10
strto = ""
For Each cell In ThisWorkbook.Sheets("Sheet1") _
.Range("C" & I).Resize(10).Cells.SpecialCells(xlCellTypeConstan ts)
If cell.Value Like "?*@?*.?*" Then
strto = strto & cell.Value & ";"
End If
Next
strto = Left(strto, Len(strto) - 1)

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"

On Error Resume Next
With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
.Send 'or use .Display
End With
On Error GoTo 0
Next I

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


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



"Ed" wrote in message ...
Ron,

Thanks!

That sets up the message in an Outlook message. I then have to click on the Send manually. Can I
automate that final step? I wouldn't mind doing it manually if I wanted to but all recipients in
the same message. However, since there will be about 150 addresses I'm a little afraid
it will be treated as Spam by someone along the way.... or I might even be fingered as a spammer
and get put on a blackhole list! If I can automate the send I could put it in a loop and send out
15 messages each to 10 people. What do you think?

Ed

"Ron de Bruin" wrote in message ...
Hi Ed

Try this example

http://www.rondebruin.nl/mail/folder3/smallmessage.htm
If you use Example 2 you can add the text in a text file

Change the To line to .To = strto

And add the code below to the macro to send to all the addresses in Column C in "Sheet1"

Dim cell As Range
Dim strto As String
For Each cell In ThisWorkbook.Sheets("Sheet1") _
.Columns("C").Cells.SpecialCells(xlCellTypeConstan ts)
If cell.Value Like "?*@?*.?*" Then
strto = strto & cell.Value & ";"
End If
Next
strto = Left(strto, Len(strto) - 1)



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







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default E-mail to a list in worksheet

Yeah, that makes sense. I couldn't figure out what the difference was
between display and Display :-)

Ed

"Ron de Bruin" wrote in message
...
Oops

I update almost all pages yesterday and forgot to change it on this
page to
.Send

Try this one you can change Send to Display to test it

Sub Mail_small_Text_Outlook()
' Is working in Office 2000-2007
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim cell As Range
Dim strto As String
Dim I As Integer


Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon

For I = 1 To 150 Step 10
strto = ""
For Each cell In ThisWorkbook.Sheets("Sheet1") _
.Range("C" &
I).Resize(10).Cells.SpecialCells(xlCellTypeConstan ts)
If cell.Value Like "?*@?*.?*" Then
strto = strto & cell.Value & ";"
End If
Next
strto = Left(strto, Len(strto) - 1)

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"

On Error Resume Next
With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
.Send 'or use .Display
End With
On Error GoTo 0
Next I

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


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



"Ed" wrote in message
...
Ron,

Thanks!

That sets up the message in an Outlook message. I then have to
click on the Send manually. Can I
automate that final step? I wouldn't mind doing it manually if I
wanted to but all recipients in
the same message. However, since there will be about 150 addresses
I'm a little afraid
it will be treated as Spam by someone along the way.... or I might
even be fingered as a spammer
and get put on a blackhole list! If I can automate the send I could
put it in a loop and send out
15 messages each to 10 people. What do you think?

Ed

"Ron de Bruin" wrote in message
...
Hi Ed

Try this example

http://www.rondebruin.nl/mail/folder3/smallmessage.htm
If you use Example 2 you can add the text in a text file

Change the To line to .To = strto

And add the code below to the macro to send to all the addresses
in Column C in "Sheet1"

Dim cell As Range
Dim strto As String
For Each cell In ThisWorkbook.Sheets("Sheet1") _
.Columns("C").Cells.SpecialCells(xlCellTypeConstan ts)
If cell.Value Like "?*@?*.?*" Then
strto = strto & cell.Value & ";"
End If
Next
strto = Left(strto, Len(strto) - 1)



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











  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default E-mail to a list in worksheet

Ron,

Everything is working pretty good. One thing I'd like to do though is
to set the mail account under which
the messages will be sent. What happens now is the .Send puts all the
messages into the Outlook Outbox folder,
getting sent next time I do a Send all from the Tools menu. However,
they will all go out under my default
mail account. I would like them to go out under another mail account
I've set up speciffically for e-mails
related to the club. I've tried .Account =
but that has no effect.

Any ideas?

TIA



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
to mail a list of mail ids with same matter anil Excel Discussion (Misc queries) 1 March 12th 07 08:27 AM
E-mail from list of users Sunnyskies Excel Discussion (Misc queries) 2 December 19th 06 09:27 AM
how do I mail from a list on excell Prudential Intern Excel Discussion (Misc queries) 1 August 16th 06 04:48 PM
list of mail in BBC from excel ...Patrick[_7_] Excel Programming 2 June 20th 06 07:40 PM
mail list function samster Excel Discussion (Misc queries) 1 March 16th 05 01:32 AM


All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"