View Single Post
  #2 (permalink)  
Old December 22nd, 2003, 07:21 AM
Bill Crawley Bill Crawley is offline
Authorized User
 
Join Date: Jun 2003
Location: Great Dunmow, Essex, United Kingdom.
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First of all in your vb project you need to go to tools/refrences and select the microsoft scripting runtime. This will allow you to open the file and read a line at a time.

Something like:

Dim f As Scripting.FileSystemObject
Dim x As TextStream

Set f = New FileSystemObject
x = f.OpenTextFile(myfilename, ForReading, , TristateFalse)
Do While Not x.AtEndOfStream
    myStr = x.ReadLine
    ListBox.AddItem myStr
Loop
x.close
set f = nothing

Reply With Quote