Here is some code to get you started. You will need to add a reference to
the Microsoft xx.x Outlook Object Library and the Microsoft DAO x.xx Object
Library appropriate to the version of Office that you are using.
Dim oApp As Outlook.Application
Dim objNewMail As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim db as DAO.Database
Dim rs As DAO.Recordset
Dim strSQL as String
Set oApp = New Outlook.Application
strSQL = "Select [email] from MyTable WHERE ..."
Set db = CurrentDB
Set rs = db.OpenRecordset(strSQL, DBOpenDynaset)
Set objNewMail = oApp.CreateItem(olMailItem)
With objNewMail
rs.MoveFirst
' All recipients will get the same email
Do While Not rs.EOF
If Len(Trim(rs!email)) > 0 Then
Set objOutlookRecip = .Recipients.Add(rs!email)
objOutlookRecip.Type = olTo
End If
rs.MoveNext
Loop
.Subject = "Your subject here."
.Body = "Your text message here."
.Save
.Send
End With
hth,
--
Cheryl Fischer
Law/Sys Associates
Houston, TX
> I have a table containing personnel information, which
> includes an email address field. I want to be able to run
[quoted text clipped - 3 lines]
> there an easy way to do this? If not, how about a hard
> way? Thanks.
Mark Hettler - 24 Dec 2003 19:10 GMT
Cheryl, looks like exactly what I need. Thanks a million.
>-----Original Message-----
>Here is some code to get you started. You will need to add a reference to
[quoted text clipped - 47 lines]
>
>.
Cheryl Fischer - 24 Dec 2003 19:16 GMT
You're welcome.
--
Cheryl Fischer
Law/Sys Associates
Houston, TX
> Cheryl, looks like exactly what I need. Thanks a million.
>
[quoted text clipped - 54 lines]
> >
> >.