Susan Harkins
ssharkins at bellsouth.net
Wed May 18 10:07:28 CDT 2005
I didn't see the original post. I've got an old article on sending email from inside Access -- if the original poster thinks it might be helpful, let me know offlist and I'll send it to you. I can't find it online anymore, or I'd just send the published link. Susan H. ssharkins at bellsouth.net Sorry, I sent that in a hurry. txtBody is a control on the form that launches the code and contains standard text to be inserted into the body of each email. Check out the syntax for SendObject. SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject, MessageText, EditMessage, TemplateFile) "Limitation Report" is my subject line, Me!txtBody is the body text, and True means the email can be edited before sending. -----Original Message----- From: Gowey Mike W [mailto:Mike.W.Gowey at doc.state.or.us] Sent: 18 May 2005 15:18 To: Access Developers discussion and problem solving Subject: RE: [AccessD] E-mail Report Roz, This looks pretty good, I tried it out, but it errors out on the following part, saying it can't find "txtbody" DoCmd.SendObject acSendReport, "rpt_MONTHLYLimitationDatesCLH", acFormatRTF, rsRecipients!CLH, , , "Limitation Report", _ Me!txtBody, True What are you referring to on the last part of the above line "Limitation Report", Me!txtBody, True Thanks so much for your help. Mike Gowey MCDST, A+, LME, NET+ Team Leader - East Region Information Systems Unit -----Original Message----- From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk] Sent: Wednesday, May 18, 2005 7:58 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] E-mail Report I do something like this in the code below: Dim cnn As New ADODB.Connection Dim rsRecipients As New ADODB.Recordset Set cnn = CurrentProject.Connection rsRecipients.Open "qryLimitationRecipients", cnn, adOpenForwardOnly If rsRecipients.EOF = True And rsRecipients.BOF = True Then MsgBox "No results returned" Else rsRecipients.MoveFirst Do Until rsRecipients.EOF = True DoCmd.OpenReport "rpt_MONTHLYLimitationDatesCLH", acViewPreview, , "CLH = '" & rsRecipients!CLH & "'" DoCmd.SendObject acSendReport, "rpt_MONTHLYLimitationDatesCLH", acFormatRTF, rsRecipients!CLH, , , "Limitation Report", _ Me!txtBody, True DoCmd.Close acReport, "rpt_MONTHLYLimitationDatesCLH" rsRecipients.MoveNext Loop End If In this instance CLH is the field in my recordset containing the email address. I am running a report filtered for each row in the recordset so that people get the records relating to themselves. HTH Roz -----Original Message----- From: Gowey Mike W [mailto:Mike.W.Gowey at doc.state.or.us] Sent: 18 May 2005 14:42 To: Access Developers discussion and problem solving Subject: [AccessD] E-mail Report Is there a way to run a query from a customer table and grab the e-mail address of certain customers and e-mail each one of them a report/letter. Any help would be greatly appreciated. Thanks in advance, Mike Gowey MCDST, A+, LME, NET+ Team Leader - East Region Information Systems Unit -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com