View Single Post
  #5   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Here we Go

Only working if you use Outlook this example

Open a new workbook
InsertModule from the menu bar
Paste the sub in there
Change the path/filename to the word Doc in the code
Alt-Q to go back to Excel

Now in the C column of "Sheet1" fill in your addresses
Save the file

If you do Alt-F8 you get a list of your macro's
Select "Mail_workbook_Outlook" and press Run

You can also use a cell in "Sheet1" with the path/filename to the word Doc
if you want.(post back if you need help with that)

For testing you can change .Send to .display in the code
You can see how it look like and press the Send button manual then

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



"MrMan&Fam" wrote in message ...
Thanks so much for the prompt response. Your work looks brilliant but it's
wasted on me. I don't know anything about programming or programming in
Excel. I don't even know what to do with your program. However, if this is
what it takes, I guess there's no easy way. Thanks, anyway.

"Ron de Bruin" wrote:

Hi

Try this one with the e-mail addresses in "Sheet1" column C
Visit also my site for more examples

Sub Mail_workbook_Outlook()
Dim OutApp As Object
Dim OutMail As Object
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)

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ("C:\test.doc")
.Send 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

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



"MrMan&Fam" wrote in message ...
Say I have an Excel spreadsheet with one column of e-mail addresses. I want
to send the same piece of e-mail (a WORD file) to each address. Is there an
easy way?