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!

Execute a .PDF file from a command button 1

Status
Not open for further replies.

RangerFan

MIS
May 4, 2000
61
US
I am trying to open a specific .PDF file from an Access (2010) command button. Can anyone help with this? Any help would be greatly appreciated.
 
Have a look at the FollowHyperlink method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
If you want to show your pdf file in, let's say Acrobat Reader (or any file in their associated program, which is so nice :) ) you may use:

Code:
Public Sub OpenDocument(strDocPath As String)
Dim G As Long
G = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler " & strDocPath, vbNormalFocus)
End Sub

And just call it:
[tt]
Call OpenDocument("C:\Test\MyFile.pdf")
[/tt]

Have fun.

---- Andy
 
Why reinvent the wheel ?
No need to create any function !
Code:
Application.FollowHyperlink strDocPath

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top