3
Contributors
2
Replies
6
Views
9 Years
Discussion Span
Last Post by eanastacio20
0

Please be more specific. Specify the format of the records in the text file. Or else, state what exact problem you're facing in doing the above task.

0

'This example is for Text File
'Add Component Microsoft Windows Common Controls 6.0 (SP6)
Private Sub Command1_Click()
Dim xData As String
With ListView1
.FullRowSelect = True
.GridLines = True
.View = lvwReport
.ColumnHeaders.Add , , "DATA"
.ColumnHeaders(1).Width = 4124.977
End With
'Open a text file
Open "c:\SampleTextFile.txt" For Input As #1
'Loop until End of the Record of the text file
Do Until EOF(1)
'Read the data
Line Input #1, xData
'Passing the data to Listview Control
ListView1.ListItems.Add , , xData
Loop
Close #1

End Sub

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.