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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open An Adobe PDF File For Viewing From Access VBA

Status
Not open for further replies.

dorlesky

Programmer
Jan 1, 2002
10
AU
I'm looking to find a solution to opening an Adbobe PDF file "Read-Only" from an Access 2003 form with VBA code.

I am using a text box to supply the file path and name, and a table that stores all the file path's and names relating to the documents needed.

I would like to stay away from Hyperlinking if possible.

Thanks for reading &/or helping with this....
 
Code:
Public Sub OpenDocument(strDocPath As String)

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

Where strDocPath is, amazingly, the path of the document you wish to open. Also works for any file extension your PC supports (.doc, .wav, etc.).

Before you criticize someone, you should walk a mile in their shoes.
That way, when you criticize them, you're a mile away and you have their shoes.
 
A little chat I had with myself recently in thread222-1410995 may also be of interest.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top