CodeItBetter Programming Another VB Programming Blog

How to add contents of text file to a list box

Posted on January 4, 2012
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'Text File Handling - How to add contents of text file to a list box
Option Explicit
 
Private Sub Form_Load()
    Dim strBuff As String
    Dim strFile As String
    Dim fnum As Integer
 
    strFile = "C:\88.txt"
 
    fnum = FreeFile()
 
    Open strFile For Input As #fnum
    Do
        Line Input #fnum, strBuff
        strBuff = Trim$(strBuff)
        List1.AddItem strBuff
    Loop Until EOF(fnum) = True
    Close #fnum
End Sub
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.