Using the listview itemactivate event

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

When I double click an item (filename) in a listview, the itemactive event
is fired. How can I code it such that the item selected will be launched by
the default program for that file extension (eg, Word with a .doc file,
Photoshop with a .jpg file, etc)?

Thanks for any help.

Bernie Yaeger
 
In the doubleclick event, you can simply call:
Shell("Start <fully qualified file name>")

For example, for a file mydoc.doc on c:\, you would make a call:
Shell("Start c:\mydoc.doc")

This will cause windows to load file with the default program for that file
extension. In your case, you'll be getting the filename from the listview
items.

hope that helps..
Imran.
 
Hi Imran,

Tx for your help.

Bernie

Imran Koradia said:
In the doubleclick event, you can simply call:
Shell("Start <fully qualified file name>")

For example, for a file mydoc.doc on c:\, you would make a call:
Shell("Start c:\mydoc.doc")

This will cause windows to load file with the default program for that
file extension. In your case, you'll be getting the filename from the
listview items.

hope that helps..
Imran.
 
Back
Top