Email PDF Report Tweak Needed!

dazstarr

Registered User.
Local time
Today, 16:17
Joined
Mar 19, 2007
Messages
132
Hi

Can someone please help me? I am not a VB programmer - i just know the very basics.

I am using Stephen Lebans PDF code to create a report which converts into PDF format.

Currently the user clicks on a button to preview the report - i have added the following line (in blue) underneath the open report function.

DoCmd.OpenReport stDocName, acPreview, , "[CPID]=" & Me!CPID
Call ConvertReportToPDF(stDocName, , "C:\Documents and Settings\All Users\Desktop\ContactMessage.pdf", False, False)

This works fine - I get a preview of the report onscreen in snapshot format and the pdf saves to the desktop.

What I would like to do is add some code which will close the snapshot view and open the PDF so users can email the document via FILE - SEND.

Ideally I would prefer an outlook window to come up when they press the button with the PDF attached.

Can someone help me with this please?

Many Thanks in advance
Daz
 
Hi Daz

Be aware, the forum frowns upon people posting more than once with the same question (even if the title and wording changes slightly).

Normally you would use the Sendobject method in VBA to send an email from outlook. While it can send attachments, it can only do one attachment based on an object created within Access (afaik).

So a solution I have used is here. Take a look at the short VBA in the download. The key point is the fact that you can give the path\filename of your pdf.

So your process will be two stage. First create the PDF using Lbans method. The email using the example code.

hth

Chris
 
cool link
used the sode fo email in my project
thak you
Rob :)
 

Users who are viewing this thread

Back
Top Bottom