If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Hyperlink - partially opening
I have a field that is a Hyperlink data type. The field contains the path to
a PDF files. When I click the hyperlink in the table or form view a new window starts to appear then disappears immediately. Why can't I just click the window and have the hyperlink automatically appear on my screen? If I manually go to the directory that stores the PDF I can open the file. Any suggestions? |
#2
|
|||
|
|||
Hyperlink - partially opening
I would use the shell function:
Option Compare Database Option Explicit Private 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 Function OpenDoc(ByVal DocFile As String) As Long OpenDoc = ShellExecute(0&, vbNullString, DocFile, vbNullString, vbNullString, vbNormalFocus) End Function With some kind of click event to call the code: Private Sub cmdOpenDirectory_Click() If (Nz(Me.DocumentDirectory, "") "") Then Call OpenDoc(Me.DocumentDirectory) Else MsgBox "You must assign a document directory.", vbOKOnly, "Error" End If End Sub HTH, -- Mark Andrews RPT Software http://www.rptsoftware.com http://www.donationmanagementsoftware.com "Williams" wrote in message ... I have a field that is a Hyperlink data type. The field contains the path to a PDF files. When I click the hyperlink in the table or form view a new window starts to appear then disappears immediately. Why can't I just click the window and have the hyperlink automatically appear on my screen? If I manually go to the directory that stores the PDF I can open the file. Any suggestions? |
#3
|
|||
|
|||
Hyperlink - partially opening
I am beginning to think that perhaps my problem is related to Adobe. After I
read your post, I thought to myself "why all the code for a hyperlink field". I thought the purpose of the hyperlink data type was so you could just click the path and open the file. All of my hyperlinks are to PDF files, so as a test I did a hyperlink to an different file format & it worked fine. Any ideas on why other file formats would open in a hyperlink field, but not an adobe file? As I mentioned previously, I can open the adobe file without a problem outside of access. But when I click the hyperlink to the adobe file the window partially appears then disappears. "Mark Andrews" wrote: I would use the shell function: Option Compare Database Option Explicit Private 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 Function OpenDoc(ByVal DocFile As String) As Long OpenDoc = ShellExecute(0&, vbNullString, DocFile, vbNullString, vbNullString, vbNormalFocus) End Function With some kind of click event to call the code: Private Sub cmdOpenDirectory_Click() If (Nz(Me.DocumentDirectory, "") "") Then Call OpenDoc(Me.DocumentDirectory) Else MsgBox "You must assign a document directory.", vbOKOnly, "Error" End If End Sub HTH, -- Mark Andrews RPT Software http://www.rptsoftware.com http://www.donationmanagementsoftware.com "Williams" wrote in message ... I have a field that is a Hyperlink data type. The field contains the path to a PDF files. When I click the hyperlink in the table or form view a new window starts to appear then disappears immediately. Why can't I just click the window and have the hyperlink automatically appear on my screen? If I manually go to the directory that stores the PDF I can open the file. Any suggestions? . |
#4
|
|||
|
|||
Hyperlink - partially opening
Here's a guess:
http://support.microsoft.com/kb/897755 "Williams" wrote in message ... I am beginning to think that perhaps my problem is related to Adobe. After I read your post, I thought to myself "why all the code for a hyperlink field". I thought the purpose of the hyperlink data type was so you could just click the path and open the file. All of my hyperlinks are to PDF files, so as a test I did a hyperlink to an different file format & it worked fine. Any ideas on why other file formats would open in a hyperlink field, but not an adobe file? As I mentioned previously, I can open the adobe file without a problem outside of access. But when I click the hyperlink to the adobe file the window partially appears then disappears. "Mark Andrews" wrote: I would use the shell function: Option Compare Database Option Explicit Private 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 Function OpenDoc(ByVal DocFile As String) As Long OpenDoc = ShellExecute(0&, vbNullString, DocFile, vbNullString, vbNullString, vbNormalFocus) End Function With some kind of click event to call the code: Private Sub cmdOpenDirectory_Click() If (Nz(Me.DocumentDirectory, "") "") Then Call OpenDoc(Me.DocumentDirectory) Else MsgBox "You must assign a document directory.", vbOKOnly, "Error" End If End Sub HTH, -- Mark Andrews RPT Software http://www.rptsoftware.com http://www.donationmanagementsoftware.com "Williams" wrote in message ... I have a field that is a Hyperlink data type. The field contains the path to a PDF files. When I click the hyperlink in the table or form view a new window starts to appear then disappears immediately. Why can't I just click the window and have the hyperlink automatically appear on my screen? If I manually go to the directory that stores the PDF I can open the file. Any suggestions? . |
Thread Tools | |
Display Modes | |
|
|