stephenlecomptejr
asked on
open up an adobe document in Access
Private Sub Cutsheets_DblClick(Cancel As Integer)
End Sub
In the body of the above code, what VBA can I use to open up a .pdf document?
End Sub
In the body of the above code, what VBA can I use to open up a .pdf document?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi stephenlecomptejr,
The above answers are correct. There's no 'pdf-specific' way to just open a pdf file within Access, so a hyperlink works fine. You could also execute a Shell() statement in code, but hyperlinks work the same.
Hope this helps.
-Jim
The above answers are correct. There's no 'pdf-specific' way to just open a pdf file within Access, so a hyperlink works fine. You could also execute a Shell() statement in code, but hyperlinks work the same.
Hope this helps.
-Jim
Using the Shell statement...
'Below line goes in declarations on top of any code module
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'Use this single line to open up an URL or a file
Call ShellExecute(0&, vbNullString, sURL, vbNullString, vbNullString, vbNormalFocus)
'sURL for a web URL, otherwise any path/file/app to open up any app.
'Below line goes in declarations on top of any code module
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'Use this single line to open up an URL or a file
Call ShellExecute(0&, vbNullString, sURL, vbNullString, vbNullString, vbNormalFocus)
'sURL for a web URL, otherwise any path/file/app to open up any app.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can you expound on the above a little bit?
I'm going to have the path stored in a field called Cutsheets.
It's the name of a textbox on a datasheet form.
So when they double-click on the datasheet form it will pull up Me.[Cutsheets]
So how do I convert the above coding to have it pull up what's in Me.[Cutsheets]
I'm going to have the path stored in a field called Cutsheets.
It's the name of a textbox on a datasheet form.
So when they double-click on the datasheet form it will pull up Me.[Cutsheets]
So how do I convert the above coding to have it pull up what's in Me.[Cutsheets]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Private Sub Cutsheets_DblClick(Cancel As Integer)
Me.Label1.HyperlinkAddress
Me.Label1.Hyperlink.Follow
End Sub