Load File To Text Box

'Add 1 Text Box to your form. Set the Text Box MultiLine property to True
'Insert this code to your form:

Private Sub Form_Load()
Dim file As String
'Replace 'c:\autoexec.bat' with the file you want to load to the TextBox
file = "c:\autoexec.bat"
Open file For Input As #1
Text1.Text = Input(LOF(1), #1)
Close
End Sub

Go Back