Hi all,
I am using the below code to create a temporary file in .pdf format, open an email in outlook, attached the .pdf file & add an email address, a subject & body to the email.
Everything is working fine with the code apart from one thing, it doesn't add the signature at the bottom of the email like a new email opened with outlook always does.
Is there an additional bit of code that can be added or a change to the code that can be made so our company email signatures are added?
Thanks in advance
The code I am using
I am using the below code to create a temporary file in .pdf format, open an email in outlook, attached the .pdf file & add an email address, a subject & body to the email.
Everything is working fine with the code apart from one thing, it doesn't add the signature at the bottom of the email like a new email opened with outlook always does.
Is there an additional bit of code that can be added or a change to the code that can be made so our company email signatures are added?
Thanks in advance
The code I am using
Code:
Private Sub CreatePDFAndEmail()_Click()
Dim FileName As String
Dim FilePath As String
Dim oOutlook As Outlook.Application
Dim oEmailItem As MailItem
FileName = "Quotation Reminder " & Me.JobNumber
FilePath = CurrentProject.Path & "\Temp Files\" & FileName & ".pdf"
'create temporary file
DoCmd.OutputTo acOutputReport, "QuoteWithAirTesting", acFormatPDF, FilePath
If oOutlook Is Nothing Then
Set oOutlook = New Outlook.Application
End If
Set oEmailItem = oOutlook.CreateItem(olMailItem)
With oEmailItem
.To = Me.ContactEmail
.CC = ""
.Subject = "Quotation Reminder: " & Me.JobNumber
.Body = " "
.Attachments.Add FilePath
.Display
End With
Set oEmailItem = Nothing
Set oOutlook = Nothing
'delete temorary file
Kill FilePath
End Sub