N
ncos
Hi Peole, im having some trouble getting my access database to email the pdf
thats being created. Ive managed to get the report automatically emailed as
a HTMl file but would really love to get the PDF conversion working and as
such have tried changing the "docmd.sendobject" I did for the HTMl
conversion, so far i've got the report to convert into a pdf (half way
through the code below) but the next line of code opens up an email with the
subject and email address correct but no pdf file attached, can anybody help
me?
Private Sub Command344_Click()
On Error GoTo Err_Command344_Click
Dim stDocName As String
Dim blRet As Boolean
stDocName = "WorkOrders"
DoCmd.OpenReport stDocName, acPreview, , "WorkOrderID = " & WorkOrderID
blRet = ConvertReportToPDF("WorkOrders", vbNullString, "Trust Orthotics
Invoice - " & [InvoiceNumber] & ".PDF", False)
DoCmd.SendObject , "Trust Orthotics Invoice - " & [InvoiceNumber] & ".PDF",
, To:=[emailaddy], _
Subject:="Trust Orthotics Invoice - " &
[InvoiceNumber], EditMessage:=True
DoCmd.Close acReport, "WorkOrders"
Exit_Command344_Click:
Exit Sub
Err_Command344_Click:
MsgBox Err.Description
Resume Exit_Command344_Click
End Sub
thats being created. Ive managed to get the report automatically emailed as
a HTMl file but would really love to get the PDF conversion working and as
such have tried changing the "docmd.sendobject" I did for the HTMl
conversion, so far i've got the report to convert into a pdf (half way
through the code below) but the next line of code opens up an email with the
subject and email address correct but no pdf file attached, can anybody help
me?
Private Sub Command344_Click()
On Error GoTo Err_Command344_Click
Dim stDocName As String
Dim blRet As Boolean
stDocName = "WorkOrders"
DoCmd.OpenReport stDocName, acPreview, , "WorkOrderID = " & WorkOrderID
blRet = ConvertReportToPDF("WorkOrders", vbNullString, "Trust Orthotics
Invoice - " & [InvoiceNumber] & ".PDF", False)
DoCmd.SendObject , "Trust Orthotics Invoice - " & [InvoiceNumber] & ".PDF",
, To:=[emailaddy], _
Subject:="Trust Orthotics Invoice - " &
[InvoiceNumber], EditMessage:=True
DoCmd.Close acReport, "WorkOrders"
Exit_Command344_Click:
Exit Sub
Err_Command344_Click:
MsgBox Err.Description
Resume Exit_Command344_Click
End Sub