4 Replies - 29764 Views - Last Post: 19 March 2013 - 03:50 AM Rate Topic: -----

#1 josh0709  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 20-February 13

open file from filelistbox

Posted 17 March 2013 - 11:56 AM

ok i am maintaining an old vb6 project and it uses the driver list and the filelistbox to find file locations and now the company want to be able to open a specific file when they click on it. an example is where the file is a microsoft database they want to be able to just click on it and it opens in access so it makes it easier for them. i did some research and found something about API but i really am not sure.

thanks
Is This A Good Question/Topic? 0
  • +

Replies To: open file from filelistbox

#2 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3812
  • View blog
  • Posts: 13,526
  • Joined: 12-December 12

Re: open file from filelistbox

Posted 17 March 2013 - 12:06 PM

This looks a good tutorial. If your question is more about opening the file in the appropriate application then using Shell() is probably simplest, and it should open in the appropriate application (according to the users Windows' settings - file associations).

Or look into the ShellExecute API:

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal _
lpDirectory As String, ByVal nShowCmd As Long) As Long

This post has been edited by andrewsw: 17 March 2013 - 12:14 PM

Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3812
  • View blog
  • Posts: 13,526
  • Joined: 12-December 12

Re: open file from filelistbox

Posted 17 March 2013 - 12:17 PM

http://docs.activest...ecute_meth.html
Was This Post Helpful? 0
  • +
  • -

#4 josh0709  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 20-February 13

Re: open file from filelistbox

Posted 18 March 2013 - 12:34 AM

thanks for the help will try it today
Was This Post Helpful? 0
  • +
  • -

#5 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: open file from filelistbox

Posted 19 March 2013 - 03:50 AM

i think shell command is enough

just see this link
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1