PDF won't open

  • Thread starter Thread starter Pyrite
  • Start date Start date
P

Pyrite

Hi,

I have a form which is basically full of control buttons that follow
hyperlinks to open word documents such as mail merged letters and original
forms etc.

I have recently added another button that links to a pdf file but when I
click this the pdf tries to open but then just closes itself. The document
opens fine when done normally through my computer.

Im on Access 2003 and Adobe Acrobat.
 
1. You don't give us any code to go on so it is very difficult to help you.

2. Based on prior experience (but then isn't all experience prior!)...this
is an issue with Acrobat. You need to perform an update on your reader and
then your code should work (assuming it is right - FollowHyperlink).
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
The code I have used is Application.FollowHyperlink "PDF Address"

Hmm, I was hoping it wouldn't be Acrobat, on a large network and getting an
update may not be the easiest. Never mind, thanks for the help.
 
Try implementing the following code and see if it behaves any better.

'********************************************
'Source: http://www.pacificdb.com.au/MVP/Code/ExeFile.htm
Public Const SW_HIDE = 0
Public Const SW_MINIMIZE = 6
Public Const SW_RESTORE = 9
Public Const SW_SHOW = 5
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMINNOACTIVE = 7
Public Const SW_SHOWNA = 8
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOWNORMAL = 1

Public 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

Public Sub ExecuteFile(sFileName As String, sAction As String)
Dim vReturn As Long
'sAction can be either "Open" or "Print".

If ShellExecute(Access.hWndAccessApp, sAction, sFileName, vbNullString,
"", SW_SHOWNORMAL) < 33 Then
DoCmd.Beep
MsgBox "File not found."
End If
End Sub
'********************************************

But as I mentioned I am quite sure this is an Acrobat thing...sadly. It
basically flashes in front of your eyes for a second and then disappears.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
Back
Top