Application.FollowHyperlink (1 Viewer)

John Big Booty

AWF VIP
Local time
Today, 15:01
Joined
Aug 29, 2005
Messages
8,263
My understanding is that Application.FollowHyperlink "should" open the hyperlink in the default browser. However on my desktop PC it opens the link in IE rather than Firefox which is the default on that machine. I'm sure there must be a setting that is forcing the link to open in IE, but I just can't find it. Any ideas?
 

vbaInet

AWF VIP
Local time
Today, 06:01
Joined
Jan 22, 2010
Messages
26,374
You would imagine that IE being an MS product is what FollowHyperlink would use. It uses the Office default browser which is obviously IE. Sad huh!
 

John Big Booty

AWF VIP
Local time
Today, 15:01
Joined
Aug 29, 2005
Messages
8,263
I've got the same DB on my Lap Top and the Hyperlink opens in Firefox :confused:

Outlook on the Desk Top opens all hyperlinks in Firefox, it's just something in Access on the desk top I suspect, I just can't figure out what.
 

ChrisO

Registered User.
Local time
Today, 15:01
Joined
Apr 30, 2003
Messages
3,202
It can do that with images as well.
Try using the Shell command to force the application to use when opening it.

Chris.
 
J

Jecs Duminy

Guest
Easier to make the link a popup link calling a popup file with the video. You can control the size of the page to fit just the video. On the popup page, you can add a "Close This Window" button.
 

DCrake

Remembered
Local time
Today, 06:01
Joined
Jun 8, 2005
Messages
8,632
Place the code snippet below into the declarations section of your form

Code:
Private Declare Function ShellExecute Lib "shell32.dll" _
   Alias "ShellExecuteA" _
   (ByVal hWnd As Long, ByVal lpszOp As String, _
    ByVal lpszFile As String, ByVal lpszParams As String, _
    ByVal LpszDir As String, ByVal FsShowCmd As Long) _
    As Long
Private Declare Function GetDesktopWindow Lib "User32" () As Long

Const SW_SHOWNORMAL = 1


Now lets say you have a listbox with file names in them or a textbox with a filename in it. This file can be any type of file, doc, txt, pdf, etc


Then you can use the on click or double click event of the control to open the named file in it's native sofware. You do not need to worry about that element.

In the example below it uses a list box to get the path from column 1 and the file name from column 2.

Code:
Dim sPath As String
    sPath = Me.LstFoundFiles.Column(1)
    strFile = sPath & Me.LstFoundFiles.Column(0)
    nDT = GetDesktopWindow()
    nApp = ShellExecute(nDT, "Open", strFile, "", "C:\", SW_SHOWNORMAL)
    DoEvents
 

ChrisO

Registered User.
Local time
Today, 15:01
Joined
Apr 30, 2003
Messages
3,202
On my machine using XP and with both files associated with Paint.

By double clicking the files from Windows Explorer it uses Paint (the associated application)

With C:\445525_22_A.bmp and C:\Sunset.jpg, ShellExecute used Windows Picture and Fax Viewer to open the images.

With FollowHyperlink, C:\445525_22_A.bmp was opened with Paint.
With FollowHyperlink, C:\Sunset.jpg was opened with Internet Explorer.

From memory, Windows2000 worked correctly…
 

DCrake

Remembered
Local time
Today, 06:01
Joined
Jun 8, 2005
Messages
8,632
Gald to see you have resolved your problem:)
 

Users who are viewing this thread

Top Bottom