How do i get my program to open a file when I click on a file 
Author Message
 How do i get my program to open a file when I click on a file

How do i get my program to open a file when I click on a
file. I've associated the file type with my program but
when I double click on a file it just opens up my program
but doesn't "open" the file...how can I get the filename
of the file that I double clicked on?

Best Regards,

Alfie



Fri, 22 Jul 2005 08:36:58 GMT  
 How do i get my program to open a file when I click on a file
The only way you can "open" file directly in your program
is if the windows explorer shell passes the name of that
file to your program.

There are 2 things you should do ...

1. Modify the association so that the name of the selected
file is also passed. In Windows Explorer, goto
Tools|Folder Options and select the 'File Types' tab.
Select your file extension and click the 'Advanced'
button. Select the edit option for the open action. In
the 'Application used to perform action' box, you would
find the path to your application ... just put a "%1"
(with the quotes) at the end of it.

2. Modify your program to handle command line parameters
(if you havent done so already). The name of the selected
file would be passed as a command-line parameter which you
can get at by using the Command$ function in vb.

Hope this helps

Subuki

Quote:
>-----Original Message-----
>How do i get my program to open a file when I click on a
>file. I've associated the file type with my program but
>when I double click on a file it just opens up my program
>but doesn't "open" the file...how can I get the filename
>of the file that I double clicked on?

>Best Regards,

>Alfie
>.



Fri, 22 Jul 2005 13:26:54 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting open file name w/o opening file

2. ++ Help file problem - Opening a .hlp file on menu click

3. click a file, open prog. AND file

4. Getting API file handle to open file

5. Doubleclick a file in Windows Explorer, start my program opening that file

6. DAO Blob Adding/Extracting (audio files, text files, image files, program files)

7. NEWBE - getting a file to load from the click of a button

8. Opening a File Open window for file selection in VBA

9. opening / saving files with MS rich text box control (viewing open files)

10. Saving open file and opening new file at a specified time of day

11. VBA to open file when click on command button

12. New at Visio - DOuble clicking to open file

 

 
Powered by phpBB® Forum Software