Attaching several PDFs to an email in MS Access

LillyC
LillyC used Ask the Experts™
on
Is it possible to setup an email that automatically attaches several pdf's (once initially setup) to one recipient?
So that I can quickly and easily send a new employee their handbook and policies without having to attach each one individually?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
AlexSenior Infrastructure Analyst

Commented:
You'd be better off just doing something like a powershell script to generate the email.

$ol = New-Object -comObject Outlook.Application 
$message = $ol.CreateItem(0)
$message.Recipients.Add("Useremail")  
$message.Subject = "Website deployment"  
$message.Body = "See attached file for the updates made to the website`r`n`r`nWarm Regards`r`nLuke"
$file = "K:\Deploy-log.csv"
$attachment = new-object System.Net.Mail.Attachment $file
$message.Attachments.Add($attachment)

Open in new window

Most Valuable Expert 2012
Top Expert 2014
Commented:
What do you mean by "automatically"? Do you mean have a button on an Access form that does this? If so, then you can certainly do this in Access, but you'd have to use something like Outlook Automation to do so. The SendObject feature of Access does not allow this type of thing.

There's code everywhere to automate outlook. A good article here on EE is this one:

https://www.experts-exchange.com/articles/4316/Automate-Outlook-in-VBA-with-the-OutlookCreateItem-Class.html

The article above includes a database with code samples.
LillyCDatabase Developer

Author

Commented:
Great, thank you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial