Oct 19, 2012 #1 RangerFan MIS Joined May 4, 2000 Messages 61 Location 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.
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.
Oct 19, 2012 #2 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR Have a look at the FollowHyperlink method. Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
Oct 22, 2012 1 #3 Andrzejek Programmer Joined Jan 10, 2006 Messages 8,576 Location US 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 Upvote 0 Downvote
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
Oct 22, 2012 Thread starter #4 RangerFan MIS Joined May 4, 2000 Messages 61 Location US Thanks Andy for your time. Much appreciated! Upvote 0 Downvote
Oct 22, 2012 #5 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR Why reinvent the wheel ? No need to create any function ! Code: Application.FollowHyperlink strDocPath Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
Why reinvent the wheel ? No need to create any function ! Code: Application.FollowHyperlink strDocPath Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Oct 22, 2012 Thread starter #6 RangerFan MIS Joined May 4, 2000 Messages 61 Location US Thanks all for your help!!! Problem solved. Upvote 0 Downvote