Jeg har lige været det samme igennem, se evt.
Først skal du lave PDF'en:
report_name = "rpt_invoice"
DoCmd.OpenReport report_name, acViewPreview, , filter_conditions
'Let's print and save. Once you see it works, you can change True to False so that the file created is not opened after completion.
DoCmd.OutputTo acOutputReport, "", acFormatPDF, out_path_and_file, False, , , acExportQualityPrint
'Let's close our previewed report
DoCmd.Close acReport, report_name
Til at sende mail: (er taget fra:
http://www.eksperten.dk/guide/371 )
Dim objOl As New Outlook.Application
Dim objPost As MailItem
Dim Attachment_file As Attachments
Set objPost = objOl.CreateItem(olMailItem)
Set Attachment_file = objPost.Attachments
Attachment_file.Add full_file_name
With objPost
.subject = ""
.To = scan_mail
.BCC = ""
.Body = ""
.Send
' .Save
' .Display
End With
' objOl.Quit
Set objPost = Nothing
Set vedhæftet = Nothing
Set objOl = Nothing