I need help using this. I am not very good with VBA. I have a table labeled Main with the field Email Address containing the email addresses. I have an email template in Word named Email_Template.doc. I am needing to code something so that when I press a command button, that it sends the text in the Word document in the body of the email to all of the recipients in my table. Can anyone help me with this?
Private Sub Command0_Click()
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("AGI_180")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("E-mail Address").Value
DoCmd.SendObject , , , strEmail, , , "Subject", "Message Text"
Set rsEmail = Nothing
I have the above code so far, but here are my problems. I need it to pull it's message text from a word document and in that word document it has a <<greeting line>> that pulls from the same table above "AGI_180" the persons first and last name.
Another problem I am runnining into is that there are multiple records in the table and it is only pulling the first record. I need it to send it to all email addresses as seperate emails.