what DataMiser wrote is true... however i like to load line by line and is still really fast here is an approach like nightwalker wrote but he forget two details
(in red)
Code:
Open "C:\TextFile.txt" For Input As #1
Do Until EOF(1)
Line Input #1, TextByLine
Text1.Text = Text1.Text & TextByLine & vbNewLine
Loop
Text1.Text = Left(Text1, Len(Text1) - 1) 'Remove Last vbNewLine
Close #1
here is something you can try
you can remove my If Text1.Multiline = False... End if it is not necessary
Code:
Private Sub Command1_Click()
Dim TextByLine As String
If Text1.MultiLine = False Then
MsgBox "Please make Text1 Multiline 'True' at design time!", vbCritical, "Error"
Exit Sub
End If
Text1.Text = ""
Open "C:\TextFile.txt" For Input As #1
Do Until EOF(1)
Line Input #1, TextByLine
Text1.Text = Text1.Text & TextByLine & vbNewLine
Loop
Text1.Text = Left(Text1, Len(Text1) - 1) 'Remove Last vbNewLine
Close #1
End Sub