View Single Post
  #2  
Old February 10th 09, 05:28 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How to send email to list of individuals


Assuming, Excel is already running, and the first address is in cell "a1":

Dim Xl As Excel.Application
Dim Ws As Excel.Worksheet
Dim Rn As Excel.Range

Set Xl = GetObject(, "Excel.Application")
Set Ws = Xl.Workbooks("Mappe1.xls").Worksheets(1)

Set Rn = Ws.Range("a1")

Now you can read Rn.Value for the first address, then loop through the rows
with the Offset function until the Value="".

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en



Am Tue, 10 Feb 2009 08:45:02 -0800 schrieb jason:

I have the below code to generate an email, I would like to add a To:

block
and take the list of receipiants from an excel spreadsheet that updates
daily. How can this be done.

Sub Macro1()



Dim olApp As Outlook.Application

Dim olMsg As Outlook.MailItem



Set olApp = Outlook.Application

Set olMsg = olApp.CreateItem(olMailItem)



With olMsg



.Subject = "Hello world"

.Display

.Body = "Hello, here is my email!" & .Body

End With



Set olMsg = Nothing

Set olApp = Nothing

End Sub

Ads