help on how to open text files using a list box

luchi's Avatar, Join Date: Apr 2010
Newbie Member
am doing a project fo school and i can't figure out how to open text files using a list box please help me
0
satyedra pal's Avatar, Join Date: Mar 2010
Contributor
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