AboutRavindra Expertise visual basic application programming from design to access information, sql, engineering and commercial applications. access databases, excel.
Optional:
1) if you want me to spend quality time and do special work, i expect to be paid a reasonable price for my time.
2) if you are pleased with my reply you could consider a donation of 1$.
3) you can visit my website http://ravindra.coolpage.biz (under constrn)
Experience
Past/Present clients project work for a Norway company, and a Canadian company completed. Freelance Project work and Teaching
teaching vb
Expert: Ravindra Date: 6/27/2008 Subject: Visual Basic, Opening a file to a multi-line txt field through a FilelistBox
Question Hello,
I'm writing a program to help edit a specific .ini file for a program to help newcomers out. What I currently have is a button that says "Locate your ini file for editing", after clicking, a makeshift "Open" dialog box pops up, consisting of a drivelistbox, a directorylistbox, and a filelistbox, who all work together. The problem is, I want to know how I can take the selected file from the file list box (after hitting the "OK" button I've created) and take it from that Open dialog box, to a new form consisting of a multi-line text field to be ready for input. Then, after hitting "Finalize", automatically overwrite that file with the users new settings.
If you can help, that'd be great!
-Aaron
Answer store the path of the selected text file to a variable and use the shell command to open the same.
sample code:
to open notepad
Option Explicit
Dim adu As String
Private Sub Command1_Click()
adu = "notepad"
Shell adu, vbNormalFocus
End Sub
' notepad should be in c: otherwise specify the path to notepad.exe
to make the notepad open a particular file:
Dim pa As String, pat1 As String, pat2 As String
pat1 = "notepad "
pat2 = "C:\my documents\goobe_acc.txt"
'CHANGE THIS LINE TO THE VARIABLE OBTAINED FROM FILELISTBOX & PATH
pa = pat1 & pat2