Jump to content

How to open a file with code


mark2004
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

If you're referring to mark2004's attempt of using Run with *.doc files, you don't think it has something to

do 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...

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...