Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using 'FollowHyperlink

Status
Not open for further replies.

scottian

Programmer
Jul 3, 2003
955
GB
I have a form in a database, on the form is a list box. I click a button and the list box fills with all the file names in a folder. The next step is to select a file from the list and open it. im using the 'FollowHyperlink' method for this. This works:-

Application.FollowHyperlink "C:\Pictures\" & "Slide5.JPG"))

But im trying to tag the selection from the list box in place of "Slide5.JPG". Now this is the funny bit it will work with all other file types except for jpg. Does anyone know why.





------------------------------------------------------------------------------
Ambition..........If you dont use it, you wont lose it
 
it will work with all other file types except for jpg
Which code exhibits this behaviour ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I believe you may have a syntax problem with parenthesis

Application.FollowHyperlink "C:\Pictures\" & "Slide5.JPG"))

sam
 
I apologise. I was just trying to keep my post tidy, but i made a mess of it. Here is the code :-

Dim varList
Dim varItem

varList = Me.ListFiles.ListIndex

varItem = Me.ListFiles.ItemData(varList)

Application.FollowHyperlink (Dir$(z() & "\Pictures\" & varItem))

That will work if im trying to open a word or excel file its only i try a .jpg file that i get this error :-

Run time error '432':
File name or class name not found during Automation operation







------------------------------------------------------------------------------
Ambition..........If you dont use it, you wont lose it
 
What happens if you doubleclick a .jpg file in explorer ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
When i try to navigate to a jpg file in explorer and choose to open it i get the error :-

access to the resource 'yada yada yada' has been disallowed





------------------------------------------------------------------------------
Ambition..........If you dont use it, you wont lose it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top