mark2004 0 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 Share this post Link to post Share on other sites
Helge 3 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. Share this post Link to post Share on other sites
mark2004 0 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. Share this post Link to post Share on other sites
locomaestro 0 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 Share this post Link to post Share on other sites
Helge 3 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... Share this post Link to post Share on other sites