Nov 5, 2002 #1 adi316 Programmer Sep 10, 2002 35 CA can i make it so a text box is actually a txt file? so the textbox displays the contents of the file.
can i make it so a text box is actually a txt file? so the textbox displays the contents of the file.
Nov 5, 2002 #2 RonVaught Programmer Oct 22, 2002 62 US Option Explicit Private Sub Form_Load() Dim fso As FileSystemObject Dim tsTextStream As TextStream Set fso = New FileSystemObject Set tsTextStream = fspenTextFile("C:\Text.txt", ForReading) Me.Text1 = tsTextStream.ReadAll tsTextStream.Close Set tsTextStream = Nothing Set fso = Nothing End Sub Upvote 0 Downvote
Option Explicit Private Sub Form_Load() Dim fso As FileSystemObject Dim tsTextStream As TextStream Set fso = New FileSystemObject Set tsTextStream = fspenTextFile("C:\Text.txt", ForReading) Me.Text1 = tsTextStream.ReadAll tsTextStream.Close Set tsTextStream = Nothing Set fso = Nothing End Sub
Nov 5, 2002 #3 TheVampire Programmer May 1, 2002 828 US And make sure to add a reference to the Microsoft Scripting runtime ( Project/ References menu ). or you will get an error on the dim FSO statement. Robert Upvote 0 Downvote
And make sure to add a reference to the Microsoft Scripting runtime ( Project/ References menu ). or you will get an error on the dim FSO statement. Robert