I have this code:
When I hit the command button, an outlook email is created with a pdf called Invoice.PDF. Problem is, I want to change the name of the generated pdf file but I have no idea where that is being created!
Feel a bit foolish that I dont even know how my code works, but it was a long time ago that I created this mechanism.
Code:
Private Sub CmdEmailPDF_Click()
On Error GoTo CmdEmailPDF_Click_Err
Dim Subject As String
Subject = Me.Text38 & "-" & "Tecterra Invoice" & ".pdf"
Me.ChkInvoicePaid = True
DoCmd.OpenForm "frmrptCurrentRecordInvoice", acPreview, , "[InvoiceID]= forms!frmInvoicing![InvoiceID]"
DoCmd.SendObject acForm, "frmrptCurrentRecordInvoice", "PDFFormat(*.pdf)", "", "", "", Subject, "Hello, attached you will find a PDF of your current TECTERRA invoice.", True, ""
DoCmd.Close
CmdEmailPDF_Click_Exit:
Exit Sub
CmdEmailPDF_Click_Err:
MsgBox Error$
Resume CmdEmailPDF_Click_Exit
End Sub
When I hit the command button, an outlook email is created with a pdf called Invoice.PDF. Problem is, I want to change the name of the generated pdf file but I have no idea where that is being created!
Feel a bit foolish that I dont even know how my code works, but it was a long time ago that I created this mechanism.