A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access hyperlinks ignore file associations



 
 
Thread Tools Display Modes
  #1  
Old May 19th, 2010, 04:40 PM posted to microsoft.public.access
coffent
external usenet poster
 
Posts: 24
Default Access hyperlinks ignore file associations

Using Windows XP Control Panel / Folder Options / File Types, I have set the
"pdf" extension association to another pdf file viewer than Adobe Acrobat.
This works fine in all programs other than Access. For example, if I
double-click on a file with a pdf extension in Windows Explorer, it opens it
with the third-party viewer. However, if I create a hyperlink to that same
file in Access it is listed as "Acrobat Document" and if I double-click it,
Access ignores my file association and opens it with Adobe Acrobat. Is there
a way to get Access to honor the Windows file associations?
  #2  
Old May 19th, 2010, 05:05 PM posted to microsoft.public.access
Dorian
external usenet poster
 
Posts: 542
Default Access hyperlinks ignore file associations

Set the file associations in your browser.
The internet is not in the Windows world.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"coffent" wrote:

Using Windows XP Control Panel / Folder Options / File Types, I have set the
"pdf" extension association to another pdf file viewer than Adobe Acrobat.
This works fine in all programs other than Access. For example, if I
double-click on a file with a pdf extension in Windows Explorer, it opens it
with the third-party viewer. However, if I create a hyperlink to that same
file in Access it is listed as "Acrobat Document" and if I double-click it,
Access ignores my file association and opens it with Adobe Acrobat. Is there
a way to get Access to honor the Windows file associations?

  #3  
Old May 19th, 2010, 06:28 PM posted to microsoft.public.access
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Access hyperlinks ignore file associations

I don't think there was a question about the internet. The OP mentioned
"Windows Explorer", which is another name for My Computer. Perhaps you read
it as Intenet Explorer, or maybe I just missed something.

To the OP, this code may help. I have used a version of it, but I altered it
for some special circumstances. I think this is the original version. I
found it in a newsgroup posting. The link to the original source is no
longer active.

'Original 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

You would use it like:

ExecuteFile("http://www.YourURL.com","open")


This is the variant I used, where strFullpath is a UNC network path to a file.
I was interested only in opening the file, so I changed the arguments.

Public Sub ExecuteFile(strFullpath As String)

Dim strFilename As String
Dim strPath As String
Dim strArray() As String

strArray = Split(strFullpath, "\", -1, vbTextCompare)

strFilename = strArray(UBound(strArray))

strPath = Left(strFullpath, Len(strFullpath) - Len(strFilename))

If ShellExecute(Access.hWndAccessApp, "open", strFilename, _
vbNullString, strPath, SW_SHOWNORMAL) 33 Then
DoCmd.Beep
MsgBox "File not found."
End If

End Sub


Dorian wrote:
Set the file associations in your browser.
The internet is not in the Windows world.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".

Using Windows XP Control Panel / Folder Options / File Types, I have set the
"pdf" extension association to another pdf file viewer than Adobe Acrobat.

[quoted text clipped - 4 lines]
Access ignores my file association and opens it with Adobe Acrobat. Is there
a way to get Access to honor the Windows file associations?


--
Message posted via http://www.accessmonster.com

  #4  
Old May 19th, 2010, 06:39 PM posted to microsoft.public.access
coffent
external usenet poster
 
Posts: 24
Default Access hyperlinks ignore file associations

I don't understand your suggestion, since Access isn't using the internet.
Both the program and hyperlinked file are on my local drive. Nevertheless
(as stranger things have happened!) I tried setting the association in my
browser, but it made no difference. Access still opens the file with Adobe.

"Dorian" wrote:

Set the file associations in your browser.
The internet is not in the Windows world.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"coffent" wrote:

Using Windows XP Control Panel / Folder Options / File Types, I have set the
"pdf" extension association to another pdf file viewer than Adobe Acrobat.
This works fine in all programs other than Access. For example, if I
double-click on a file with a pdf extension in Windows Explorer, it opens it
with the third-party viewer. However, if I create a hyperlink to that same
file in Access it is listed as "Acrobat Document" and if I double-click it,
Access ignores my file association and opens it with Adobe Acrobat. Is there
a way to get Access to honor the Windows file associations?

  #5  
Old May 19th, 2010, 09:51 PM posted to microsoft.public.access
David W. Fenton
external usenet poster
 
Posts: 3,373
Default Access hyperlinks ignore file associations

=?Utf-8?B?Y29mZmVudA==?= wrote
in :

Using Windows XP Control Panel / Folder Options / File Types, I
have set the "pdf" extension association to another pdf file
viewer than Adobe Acrobat. This works fine in all programs other
than Access. For example, if I double-click on a file with a pdf
extension in Windows Explorer, it opens it with the third-party
viewer. However, if I create a hyperlink to that same file in
Access it is listed as "Acrobat Document" and if I double-click
it, Access ignores my file association and opens it with Adobe
Acrobat. Is there a way to get Access to honor the Windows file
associations?


I would look carefully at the defined file associations. My guess is
there's something else defined that is overriding it.

You could also test what the apiShellExecute API code does with it:

http://www.mvps.org/access/api/api0018.htm

The other thing that's important is to realize that Access hyperlink
fields are problematic, and in my opinion, not worth the trouble.
It's just a special case of a memo field (in order to handle links
longer than 255 characters), and I tend not to use them at all,
precisely because of this kind of unpredictability, as well as the
complications of editing them.

I can't say that converting your hyperlink to a plain memo field
will fix the problem, but it is something I'd do, anyway. It does
mean you then have to write code to open the hyperlinks, though. But
that also gives you control over what happens.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
  #6  
Old May 20th, 2010, 01:39 PM posted to microsoft.public.access
coffent
external usenet poster
 
Posts: 24
Default Access hyperlinks ignore file associations

Thanks for the suggestions, Bruce & David - I will try them.

"coffent" wrote:

Using Windows XP Control Panel / Folder Options / File Types, I have set the
"pdf" extension association to another pdf file viewer than Adobe Acrobat.
This works fine in all programs other than Access. For example, if I
double-click on a file with a pdf extension in Windows Explorer, it opens it
with the third-party viewer. However, if I create a hyperlink to that same
file in Access it is listed as "Acrobat Document" and if I double-click it,
Access ignores my file association and opens it with Adobe Acrobat. Is there
a way to get Access to honor the Windows file associations?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:58 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.