tkpstock
Cubicle Warrior
- Local time
- Today, 13:45
- Joined
- Feb 25, 2005
- Messages
- 206
Simple code, doesn't work.
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!!
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!!