This may sound dumb but for some reason in vb6 my project will not open files as it did in vb5, but only opens the last line. I dont have any help files. Please send any source code to open a .txt file.
Printable View
This may sound dumb but for some reason in vb6 my project will not open files as it did in vb5, but only opens the last line. I dont have any help files. Please send any source code to open a .txt file.
This will open a text file and put it in a TextBox:
------------------Code:Dim FileNum As Byte, FileName As String
FileName = InputBox("Enter the full path of a text file to open:")
If (Len(FileName) = 0) Or (Len(Dir(FileName)) = 0) Then Exit Sub
FileNum = FreeFile
Open FileName For Input As #FileNum
Text1.Text = Input(LOF(FileNum), #FileNum)
Close #FileNum
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
AIM: RYoni69
[This message has been edited by Yonatan (edited 12-29-1999).]