A
AJ
I have a registration database that is working well. To send out Class
Schedules I use the following VBA script (see below.
The report mentioned is set to print to Adobe Acrobat PDFwriter, so it
essentially creates a file on the hard drive, ready to be attached. The
script also creates an E-mail, and inserts the persons's E-mail, while the
report creates that person's registration.
My problem is that, for each student, I have to create an E-mail, THEN
attach the report (in PDF), THEN send it. We have over 100 students.
How can I automate this, and have a different report for each student? (Can
I turn this into a mail-gun somehow? Can I have 1 script to send each their
own schedule/confirmation?)
Function SendReg()
Dim strDocName As String
Dim strWhere As String
Dim strEmail As String
Dim strSubject As String
Dim strStudent As String
strDocName = "rptStudentRegConf"
strWhere = "[ID]=" & Forms!frmStudent!ID
strEmail = Forms!frmStudent!ParentEmail
strSubject = Forms!frmStudent!FirstName & "'s ASSI 2005 Registration
Confirmation"
strMessage = Forms!frmStudent!ParentName & "," & vbCrLf & vbCrLf & "I
have attached the confirmation of what we have for " &
Forms!frmStudent!FirstName & ". " & vbCrLf & vbCrLf & "Is this all correct?"
DoCmd.OpenReport strDocName, acViewNormal, , strWhere
DoCmd.SendObject acSendNoObject, strDocName, , strEmail, , , strSubject,
strMessage
End Function
Schedules I use the following VBA script (see below.
The report mentioned is set to print to Adobe Acrobat PDFwriter, so it
essentially creates a file on the hard drive, ready to be attached. The
script also creates an E-mail, and inserts the persons's E-mail, while the
report creates that person's registration.
My problem is that, for each student, I have to create an E-mail, THEN
attach the report (in PDF), THEN send it. We have over 100 students.
How can I automate this, and have a different report for each student? (Can
I turn this into a mail-gun somehow? Can I have 1 script to send each their
own schedule/confirmation?)
Function SendReg()
Dim strDocName As String
Dim strWhere As String
Dim strEmail As String
Dim strSubject As String
Dim strStudent As String
strDocName = "rptStudentRegConf"
strWhere = "[ID]=" & Forms!frmStudent!ID
strEmail = Forms!frmStudent!ParentEmail
strSubject = Forms!frmStudent!FirstName & "'s ASSI 2005 Registration
Confirmation"
strMessage = Forms!frmStudent!ParentName & "," & vbCrLf & vbCrLf & "I
have attached the confirmation of what we have for " &
Forms!frmStudent!FirstName & ". " & vbCrLf & vbCrLf & "Is this all correct?"
DoCmd.OpenReport strDocName, acViewNormal, , strWhere
DoCmd.SendObject acSendNoObject, strDocName, , strEmail, , , strSubject,
strMessage
End Function