Shell Command

tkpstock

Cubicle Warrior
Local time
Today, 03:26
Joined
Feb 25, 2005
Messages
206
Simple code, doesn't work.

Code:
Private Sub MyFile_Click(f as String)
     ans = Shell(f, vbMaximizedFocus)
End Sub

The value of f is an arbitrary path and filename. I get an "Invalid Procedure Call" on the Shell command. Can shell open non-executable files using the default MIME type?

Essentially, I have a database that tracks contracts. The contracts are stored locally on the user's hard drive, and they can be in any number of formats (Word, PDF, JPG, WordPerfect, etc). I've got a field that stores the path to the file - I would like to be able to open the file with the click of a button using the stored path. How can I do this?

Thanks in advance!!
 
Try:

Code:
Private Sub MyFile_Click
     Application.FollowHyperlink Me.YourFieldNameHere
End Sub

Brad.
 
Works like a charm! Thanks!!! :)
 

Users who are viewing this thread

Back
Top Bottom