Er... I was going to suggest this

read all the file into an array of strings and using this sort of thing:


Code:
Dim strLine() As String

Sub readFile()
Dim i As Long
Open "TESTFILE" For Input As #1 ' Open file.

Do While Not EOF(1) ' Loop until end of file.
  ReDim Preserve strLine(i)
  Line Input #1, strLine(i + 1) ' Read line into variable.
 i = i + 1
Loop
Close #1  ' Close file.
End Sub
write a simple procedure to write one element
in a textbox
Code:
For i = 0 To UBound(strLine()) - 1

  if len(strLine(i))> MAXLEN then' defien maxlen as a constant
 text1.text = strLine(i)
exit for
end if
 
Next i
then write it all back out:
Code:
Sub WriteFile()
Dim i As Long

Open "TESTFILE" For Output As #1  ' Open file for output.
For i = 0 To UBound(strLine()) - 1

  Print #1, strLine(i)
Next i
Close #1  ' Close file.
 
  
End Sub
------------------
Mark Sreeves
Analyst Programmer

[email protected]
A BMW Group Company


[This message has been edited by Mark Sreeves (edited 11-08-1999).]