mutiple email merge to outlook
im using ms access and outlook 2003
i have a query wich i run, and it brings me a list of customers with details. im more concerned with the email addresses. i want to send an email to mutiple recipients. (the one's searched for)
i can use a piece of code, but it only adds the first email address, can anyone help me to get this code to add the next email adresses of the people down the table.
im not very good with loops
Private Sub SendAnEmail_Click()
On Error GoTo ErrorHandler
Dim objOutlook As Object 'Outlook.Application
Dim EmailAddress As String
Set objOutlook = CreateObject("Outlook.Application")
Set objMailItem = objOutlook.CreateItem(0)
DoCmd.RunCommand acCmdSaveRecord
EmailAddress = Me!EMail
With objMailItem
.To = EmailAddress
.Subject = "Subject Here"
.body = "email text Here"
.display
End With
Exit Sub
ErrorHandler:
MsgBox "Error Number:" & Err.Number & "" & Err.Description
End Sub
Help!!!:(
Joey
|