How Can I attach multiple PDF file using below code? (1 Viewer)

Ashfaque

Student
Local time
Tomorrow, 01:08
Joined
Sep 6, 2004
Messages
894
Gents,

I am using following code and it successfully attach my report in email. But I need to add another pdf file along with in same email.

Dim strMailList, StrCC As String

strMailList = CEmail
StrCC = "xyz@gmail.com"

DoCmd.SendObject acSendReport, "R_JobOffer", acFormatPDF, strMailList, StrCC, , "JOB OFFER LETTER - " & LetterRefNumber & _
" - " & CName & " - " & Format(Now()), "Dear " & CName & "," & vbCr & vbCr & "With reference to our discussion during " & _
"interview and according to your qualification, we are pleased to offer you an employment at our International Agent Company." & _
" We feel your skills and experience will be valuable assets to our team." & vbCr & vbCr & "If you choose to " & _
"accept this offer, please sign and re-send back to us as your acceptance." & vbCr & vbCr & "Good Luck and Best Regards," & _
vbCr & vbCr & "Sincerely," & vbCr & vbCr & "Brian Clark" & vbCr & "Human Resources Dept.", True

The primary key is set on field LetterRefNumber where all the data of R_JobOffer and the additional pdf file which I want to attached in email are in one table called. T_JobOffer. But some other data are coming from another table called T_JD_Footer.

In other words, both table T_JobOffer and T_JD_Footer are in one to many relationship set on LetterRefNumber.

Is there any chance to know if it is possible?

Kindly support.
Regards,
Ashfaque
 

Gasman

Enthusiastic Amateur
Local time
Today, 19:38
Joined
Sep 21, 2011
Messages
14,046
I do not believe you can.?
You need to use Outlook automation.?
 

Dreamweaver

Well-known member
Local time
Today, 19:38
Joined
Nov 28, 2005
Messages
2,466
Last edited:

Isaac

Lifelong Learner
Local time
Today, 12:38
Joined
Mar 14, 2017
Messages
8,738
The VBA you are using automates Outlook behind the scenes anyway, you might as well switch to Outlook automation as Gasman mentioned and you could attach as many pdfs as you like.
 

Users who are viewing this thread

Top Bottom