OK I have sussed how to:
All great except one tiny detail. I need the email to send using the HTML font and style set in Outlook and include our standard .htm signature that contains several images. So tantalisingly close but I have read that using DoCmd.SendObject restricts everything to Plain Text
- attach a report as a PDF
- Change the Caption so it adds the unique invoice number to the name of PDF file
- Add the Invoice number to the Subject of the email
- Get the TO email address from the customer record
- Get the First Name of the customer and write the email
Code:
Dim strReportName As String
strReportName = "Invoices2"
DoCmd.OpenReport strReportName, acViewDesign, , , acHidden
Reports(strReportName).Caption = "Invoice-" & Me.InvoiceNo
DoCmd.Close acReport, strReportName, acSaveYes
DoCmd.SendObject acSendReport, strReportName, acFormatPDF, Me.WorkEmail, , , "Easykey - Invoice-" & Me.InvoiceNo, "Hello " & Me.FirstName & "," & _
vbNewLine & vbNewLine & _
"Please find attached Invoice Number " & Me.InvoiceNo & _
vbNewLine & vbNewLine & _
"Kind Regards, Sue Brown (Administrator)"
All great except one tiny detail. I need the email to send using the HTML font and style set in Outlook and include our standard .htm signature that contains several images. So tantalisingly close but I have read that using DoCmd.SendObject restricts everything to Plain Text