To create an email with a PDF attachment in Outlook you need to add a reference to the "Microsoft Outlook (number) Object Library". Then use code like this:
Code:
Dim olApp As Outlook.Application
Dim olEmail As Outlook.MailItem
Set olApp = New Outlook.Application
Set olEmail = olApp.CreateItem(olMailItem)
With olEmail
'set up addresses, subject and body text as required
.Attachments.Add "C:\mydoc.pdf"
End With
Set olEmail = Nothing
Set olApp = Nothing
The tricky part is making the PDF file in the first place. You'll need another reference to some software that allows you to automate creating PDFs. Maybe you have access to Acrobat Professional? I'm sure that will let you do it somehow. If you need a freebie then it looks like this might do it too:
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.