Making documents with info from a form, and e-mail them with attachments

Gijs

Registered User.
Local time
Today, 04:11
Joined
Oct 22, 2012
Messages
15
Hi Guys,

I'am try to build in some automatisation in my application.
I want to programm a button wich makes up two documents (pdf) with information from a form and then emails both documents and a couple other attachements from the HD to a recipient.

What is the best method to doe this? Sending objects form Access doesn't have the option of extra attachements....:banghead:

Thanks in advance!
 
Suggestion, create a report that looks exactly like the form and or how you want it to, it then finds its data based on the form and then you can output or save the report as PDF. Then you can use some VBA code to send an email and use something like this, which is using Outlook. you have to set the references in the VBA screen to use Outlook.

Sub sendForApproval()
'*************************************************
'VBA Code created by Trevor G November 2009
'*************************************************
Dim olApp As Outlook.Application
Dim olMail As MailItem
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
With olMail

.To = "Person@Company.co.uk" & ";" & "Another name@Company.co.uk"
.Subject = "Access Request"
.Body = "Please can you provide access to the Database system." & vbCr & vbCr & _
"The required details are as follows my First and Last Name is: " & vbCr & _
"My User ID is: " & vbCr & _
"My Computer Name is: "

.Attachments "Location and File name.pdf"

.Display

End With
Set olMail = Nothing
Set olApp = Nothing
End Sub
 
Thanks Trevor,

The only problem is that the Output Filename is the same every time...
 

Users who are viewing this thread

Back
Top Bottom