Preview or print a PDF from Access

MarionD

Registered User.
Local time
Today, 17:23
Joined
Oct 10, 2000
Messages
425
Hi all,

I have a Help/What is new Document in PDF format. How can I preview this document from a button (or better even my menu bar) within my DB? I'd like to include a menu Option "Help" and this should open the PDF file.

Thanks for any help
Marion
 
Make a button and put this code on click :

Private Sub Command46_Click()
On Error GoTo Err_Command46_Click

Dim stAppName As String

stAppName = "D:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe"
Call Shell(stAppName, 1)

Exit_Command46_Click:
Exit Sub

Err_Command46_Click:
MsgBox Err.description
Resume Exit_Command46_Click

End Sub



In this example the Acrobat program is on D:\Porgram files\ etc
When making the button allocate Run application.

Once in the Acrobat reader you'll need to open the *.pdf you're looking for.


RAK
 
Hi RAK and thanks for the answer.

Can I could bother you a bit more?

What if I don't know where (or even if) Adobe/Acrobat is loaded on the computer? Can I do some sort of search for the acrobat exe and if it's not found, bring an error msg saying something like "Acrobat Reader is not installed. This document cannot be opened".

Marion
 
I have played around with have changed the sub as follows :

Private Sub Command68_Click()
On Error GoTo Err_Command68_Click

Dim stAppName As String

stAppName = "E:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe"
Call Shell(stAppName, 1)

Exit_Command68_Click:
Exit Sub

Err_Command68_Click:
MsgBox " not found"


Resume Exit_Command68_Click

End Sub


You're now getting a message box saying " not Found" ( note the change from D to E drive).

The only thing I can think of is keep the command line : stAppName = "D:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" , the same for all computers and it will give you at least some indication what stations have adobe installed and those who haven't.

You might need to change the D to C drive.

Don't know if this is the most elegant solution but it works in my department.

Ron
 
Thanks Ron.

Will play about a bit more and let you know how I get on!

Marion
 

Users who are viewing this thread

Back
Top Bottom