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!

How can I open a pdf file from MS Access? 1

Status
Not open for further replies.

dspiker

Programmer
Jun 26, 2003
2
US
I have a field in a table that stores the full file path to a .pdf document. I am searching for a way to use that file path to open acrobat reader and display the pdf document refered to in the file path. I can use the Shell command to open Acrobat Reader, but it won't allow me to pass a specific file. Does anyone have any advice on this? Sure would appreciate any assistance. Thanks.
 
in response to:

I have a field in a table that stores the full file path to a .pdf document. I am searching for a way to use that file path to open acrobat reader and display the pdf document refered to in the file path. I can use the Shell command to open Acrobat Reader, but it won't allow me to pass a specific file. Does anyone have any advice on this? Sure would appreciate any assistance. Thanks.

'/////////////////////////////////////////////////////

try creating a command button or, better yet, a label and assigning the path and filename of the .pdf document (as can be seen in it's properties when you right-click on the file in windows explorer) to the hyperlink address of this new button or label.

the caption can be "Open" or "View" or any other string that suits your fancy and makes the control's purpose plain to the user.

the hyperlink address itself can be manipulated by your vba code at run time if neccessary, as it would be if you pick the document's decription off of a list of many documents and then need to press a button to open it, or it can be static if, like a help document, the button would only ever be used to access one .pdf file.

acrobat reader would, by the way, open on it's own when the user follows the link to the file, so there is no need to open it separately.
 
Spiralmind,

I appreciate you taking the time to respond to my question. I actually resolved the issue a little differently, but I appreciate your advice anyway.

Thanks
 
You can create a hyperlink data field and provide the path to the file you want to open... or you can use VB...
 
Even if it was stored in a text field, you could try the following (which works for more than just hyperlinks):

Application.FollowHyperlink Me!txtFilepath

It will open whatever is in txtFilepath with the associated application.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top