Email Report as PDF

A

ant1983

Right so im either going mad or somehow my previous post regarding the
following issue was somehow deleted... Here goes... (again)

What i want to do is email a report as a PDF file. I vaguegly remember in
my previous post that the response was basically that this cant be done
unless you have Office 2007...

Well, i just bought office 2007 and cant figure out how to do this...

Cheers guyz!!!!!!!!!!
 
A

ant1983

Riiiight, so Im def NOT going mad!! Def did post that question coz i
remember someone referring me to the below link thats a download for an
add-in for Office 2007...

Thought i'd share it:

http://www.microsoft.com/downloads/...iCWFsE2kAHKH++SB/s78dPPKgX27WA9QatJ6QII5jrQ==

Dowload and install takes like 30 seconds and if you reopen any office
application you can save docs as pdfs (or in my case email reports as pdfs as
appose to snapshot docs)

Happy PDF-ing...

LAta
 
D

dch3

But do you have code to email it?

Here's a sample if you don't...

sub createOutlookMailItem

Dim objOutlook As Outlook.Application
Dim newMail As MailItem

Set objOutlook = CreateObject("Outlook.application")
Set newMail = objOutlook.CreateItem(olMailItem)

newMail.To = "(e-mail address removed)"
newMail.Body = "The Office ribbon sucks like Dvorak"

Set newMailAttachments = newMail.Attachments

'If you're pulling records from a file, you'd start the loop here
changing the next
'line to file1 = rs("fieldName") or whichever way you prefer to pull the
value from
'the recordset you're working with, this code was done as a
proof-of-concept,
'so I used the file1 variable just to make the next line easier to read
it can
'be eliminated if needed
'I would definately check to see if the file exists first using the
FileExists property
'of the File System Object
'Set fs = CreateObject("Scripting.FileSystemObject")
'fs.FileExists(fileName)
'If FileExists fails, you could then present the CommonDialog to give
the users
'the option of searching for the file themselves (see mvps.org for that
aspect of
'it)

'change rptConfirmation.snp to the PDF's file name
file1 = strTargetFolder & "\rptConfirmation.snp"
newMailAttachments.Add file1, olByValue, 1

'end the loop here

newMail.Subject = "Documents Confirmation"
newMail.OriginatorDeliveryReportRequested = True
newMail.ReadReceiptRequested = True
newMail.Display

Set newMailAttachments = Nothing
Set newMail = Nothing
Set objOutlook = Nothing

end sub

You may also want to check out the .SaveSentMessageFolder property as it
would allow you to have the sent messages saved in a specific folder - either
at the user level or in a public folder.

http://msdn.microsoft.com/en-us/library/aa171932(office.11).aspx
 
T

Tony Toews [MVP]

ant1983 said:
What i want to do is email a report as a PDF file. I vaguegly remember in
my previous post that the response was basically that this cant be done
unless you have Office 2007...

A2000ReportToPDF is an Access 2000 database containing a function to
convert Reports and Snapshot files to PDF documents. No PDF Printer
driver is required.
http://www.lebans.com/reporttopdf.htm

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top