Private Sub Command1_Click()
Dim Buffer As String
Dim F As Integer
Dim FilePath As String
FilePath = "C:\Some Folder\Another Folder\YourFile.txt"
F = FreeFile
Buffer = Space(FileLen(FilePath))
Open FilePath For Binary As #F
Get #F, , Buffer
Close #F
Text1.Text = Buffer
End Sub
or you could add a reference to the Microsocoft Scripting Runtime library, and then use the fractionally shorter: [tt]
With New FileSystemObject
Text1.Text = .OpenTextFile("C:\test.txt".ReadAll
End With [/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.