help on how to open text files using a list box

Newbie Member
28Apr2010,06:18   #1
luchi's Avatar
am doing a project fo school and i can't figure out how to open text files using a list box please help me
Contributor
28Apr2010,12:04   #2
satyedra pal's Avatar
For adding any file in the listbox of visual basic we use the following code:

Quote:
Sub FillListBox()

Dim lfiles As String

listbbox.Clear

Open "D:\SATYA\NEW.TXT" For Input As #1(file no.)

While Not EOF(1)

Line Input #1(file no.), lfiles(variable)

listbbox.AddItem lfiles

Wend

Close #1

End Sub