I looked here and found this thread but there was no answer.
thread707-591135
Anyway I have a table with names, emails and the pdf file name. which are all in the same folder.
I want to create 1 email for each person (record) and attach the correct pdf to it.
Can this be done?
I have used docmd.sendobject a lot. but it seems to want to send only Access objects.
here is my code so far
DougP
thread707-591135
Anyway I have a table with names, emails and the pdf file name. which are all in the same folder.
I want to create 1 email for each person (record) and attach the correct pdf to it.
Can this be done?
I have used docmd.sendobject a lot. but it seems to want to send only Access objects.
here is my code so far
Code:
Dim subject, Email, message As String
Dim ChildLName, ChildFName, ParentName As String
Dim pdfFile As String
ChildLName = Forms![frmEmailParentsform]![Data from pdf Latest subform1].Form![Childs Last Name]
ChildFName = Forms![frmEmailParentsform]![Data from pdf Latest subform1].Form![Childs First Name]
ParentName = Forms![frmEmailParentsform]![Data from pdf Latest subform1].Form![Childs First Name]
pdfFile = Forms![frmEmailParentsform]![Data from pdf Latest subform1].Form![PDFAdmissionFile]
subject = "2012-13 Student Admission form(s)"
message = "To the Parents of " & ChildFName & " " & ChildLName & vbCrLf
message = message & "This is the new 2012-13 Student form with all of the information which was put on last years form." & vbCrLf
message = message & "When everything is correct then send them back to me." & vbCrLf
Email = Forms![frmEmailParentsform]![Data from pdf Latest subform1].Form![EMail Address]
'this launches Outlook but then I have to manually go attach the file
DoCmd.SendObject acSendNoObject, "", acFormatTXT, Email, , , subject, message
DougP