mark2004 Posted January 23, 2007 Posted January 23, 2007 I would like to be able to use code to open a generic file, i.e. a word document or image file. Just as if you double-clicked it from windows explorer. I can use the FileOpenDialog to obtain the file's path but how do I open it?? I know this one has to be dead simple...... Mark
Helge Posted January 23, 2007 Posted January 23, 2007 ShellExecute in the newest version would be what you're searching for. You could manage to do some fiddling with Run and make it work using that as well, but ShellExecute is the easiest and best way to go.
mark2004 Posted January 23, 2007 Author Posted January 23, 2007 Thanks Helge. I tried using the Run function and just putting in the filename "manual.doc" and it didn't work. I didn't know how else to fiddle with Run. I haven't downloaded the latest version so I'll do that first and give ShellExecute a go.
locomaestro Posted January 23, 2007 Posted January 23, 2007 you have to put the whole path and the filename to make it work it you just put manual.doc it will assume is in the windows directory
Helge Posted January 23, 2007 Posted January 23, 2007 you have to put the whole path and the filename to make it work it you just put manual.doc it will assume is in the windows directoryIf you're referring to mark2004's attempt of using Run with *.doc files, you don't think it has something todo with the fact that a Word document isn't a executable file and because it's not listed as a supported file-type for Run ? It's not just a matter of putting the whole path as you say...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now