Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search file and open... 1

Status
Not open for further replies.

tekthis

MIS
Jun 9, 2004
77
0
0
US
hello...i have files that are stored in a folder...i created a program to retrieve all of the files in this folder and they are displayed in a FileListBox...when i double click on a certain file in the list i want to have it open up in Notepad...i have the search to work but i can't get the open to work...this is what i have so far...

Private Sub cmdSearchMod_Click()
flbViewMod.Path = "C:\Test"
flbViewMod.Pattern = "*mod.*"
End Sub
Private Sub flbViewMod_DblClick()
Shell "Notepad.exe" & " " & "C:\Test\(i dont know)", vbMaximizedFocus
End Sub

thanks for your help...
 
Try looking at the ShellExecute API ( and pass the name of the file from from FileListBox for the selected file to open with Notepad.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
thats not what im looking for...i just need the file that i have double-clicked from the FileListBox to open in notepad...since i have so many files i think i need to pass the one i selected through a parameter...

Private Sub cmdSearchMod_Click()
flbViewMod.Path = "C:\Test\"
flbViewMod.Pattern = "*mod.*"
End Sub

Private Sub flbViewMod_DblClick()
Shell "Notepad.exe" & " " & "C:\Test\(((VARIABLE)))", vbNormalFocus
End Sub

thanks for your help...
 
Shell "Notepad.exe" & " " & "C:\Test\" & flbViewMod.FileName, vbNormalFocus


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

For tsunami relief donations

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
thanks...i just found that .filename a second ago...and it worked...thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top