Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving an access report in PDF Format 1

Status
Not open for further replies.

pcdaveh

Technical User
Sep 26, 2000
213
US
I have this great database that I use to send our clients invoices via email. There is just one problem that I keep having to face with some clients. Some clients won't accept the invoice that comes through email. Since the invoices are sent as an attachment using the SendObject commad, they are sent using a RTF extension. The client recieves the invoice and it is possible for anyone to change the document. This leave some Accounts Payable people very leary. I'm trying to find away to produce in Access a document that is unchangeable such as in PDF Format. Does anybody know how to accomplish this? The format will also need to comply with the Sendobject command. I've tried in the past to send OLE objects and didn't succeed.
 
I have Adobe and tried and I see what you mean.
But try instead to save it to HTML
Which cannot be edited, easily.

DoCmd.SendObject acSendReport, "rpt-Apartment", acFormatHTML, "douglasp", , , "Adobe file", "", False

And if they know how to edit HTML then they could also edit Adobe if they had the full Adobe program.

DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
OK, here we do send PDF via Email. The Report must first have been saved after manually sending it to PDF form, Then you can succeed with code. It isn't very reliable sometimes and you need to buy and link in a PDF library from a third party vendor. "ACG PDF and Mail Library" => "PDF and Mail Library.mde" shows in my code references.

After creation then you send with more code to outlook express etc...
(You may also have to have a ref set to the WinFax Automation Server file wfctl32.tlb.....)

Here are the code clips......................

'The following code sample with generate a PDF document from a report named
'"Report1" using the PDFWriter print driver.
'Copyright © 1997-2000 ATTAC Consulting Group

Dim objPDF As New PDFClass

sReport = "Report1"

With objPDF
.ReportName = sReport
.ImageType = "PDF"
.PDFNoShowPropDlg = True
.OutputFile = sPath & sExtPath & sFile
If bLandScape Then 'Use=True, landscape=2, (letter=1,legal=5)
.AdvancedRptProp True, 2, 5
End If
If sWhere <> &quot;&quot; Then
.ReportWhere = sWhere
End If
.PrintImage
lngResult = .Result
End With

---------------------------------------------
Dim Email As clsEmail
Dim Attachment As clsFile

Set Email = New clsEmail
Set Attachment = New clsFile
If Not IsMissing(FileName) Then
Attachment.FileName = CStr(FileName)
Else
Attachment.FileName = CStr(&quot;SomeFileName&quot;)
End If
Email.MessageSubject = &quot;Subject Here&quot;
Email.MessageText = &quot;Body of the text, A memo maybe?&quot;
Email.RecipientAddress = &quot;EMailAddress&quot;
Email.RecipientName = &quot;ClientRecipientCompany&quot;
Email.Attachments.Add Attachment
Email.JobID = Trim(rs!CustomerID) & Trim(rs!ReportSuffix)
Email.Send
Set Email = Nothing
Set Attachment = Nothing

That's all I got, except to say the product has more examples and directions to give..

If you need more help search the internet for the specialized data types shown above......
 
I figured out a way to save an Access report as a .pdf file

Here's how:

Get the Adobe Acrobat Distiller (might be able to get it free off their site)
This will allow you to print to a &quot;printer&quot; called Distiller Assistant (it's more like &quot;scanned&quot; to it). In order to do this, you'll have to go to your report's Page Setup and change your printer settings.

With the Distiller open, print your report (with &quot;Distiller Assistant&quot; as your printer). This will create a PostScript (.ps) file (for me it saved it to C:\ by default). The file is called &quot;Distasst.ps&quot;. Drag this file into the Distiller text window (remember, the program should be open) and bingo, there you are.You could also go to &quot;Open&quot; on the Distiller menu. If you don't specify what the new file will be called, the program will by default save it as &quot;DISTASST.pdf&quot; and it will be located in the same place as the .ps file. You'll need Adobe Acrobat to view it, but that's a relatively popular program.

Hope this saves people some trouble. I figure I'm constantly posting questions up on here and everyone has been extremely helpful to me, so its time to hook it up and give something back.

Have fun
Mike


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top