Hello!
Am working in MS Access 2013 and I have a form with a button, I need the button to doattach automatically the pdf-report to the email template(i don't want to attach the pdf to a new email)
Right now the command open the E-mail template and create the pdf-report in the desktop
All suggestions are welcome
Am working in MS Access 2013 and I have a form with a button, I need the button to doattach automatically the pdf-report to the email template(i don't want to attach the pdf to a new email)
Right now the command open the E-mail template and create the pdf-report in the desktop
All suggestions are welcome
Code:
Private Sub Command18_Click()
Dim oApp As Outlook.Application
Dim oMsg As Outlook.MailItem
Dim oAttachment As Outlook.attachment
Set oApp = New Outlook.Application
Set oMsg = oApp.CreateItemFromTemplate("*\\filepath*\comienzo_campana.oft")
DoCmd.OutputTo acOutputReport, "email-campanas-lista", acFormatPDF
If Not oMsg Is Nothing Then
oMsg.Display
Set oMsg = Nothing
Else
MsgBox "Template Not Found. Contact I.T team"
End If
End Sub