by M. Adeel [ The National College ] (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 28th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Sample to Use Scripting.FileSystemObject Reference to Create/Read Text File
API Declarations
Dim fso As FileSystemObject
Dim f As TextStream
Set f = fso.CreateTextFile("C:\new.txt")
f.WriteLine ("This is a Text File")
f.WriteLine ("This is a Text File")
f.WriteLine ("This is a Text File")
f.WriteLine ("This is a Text File")
f.WriteLine ("This is a Text File")
f.WriteLine ("This is a Text File")
f.WriteLine ("This is a Text File")
f.Close
Set f = fso.OpenTextFile("C:\new.txt", 1)
MsgBox f.ReadAll
f.Close
Set f = fso.OpenTextFile("C:\new.txt", ForAppending)
f.WriteLine ("This is new text")
f.Close
Set f = fso.OpenTextFile("C:\new.txt", 1)
MsgBox f.ReadAll
f.Close
End Sub
No comments have been posted about Sample to Use Scripting.FileSystemObject Reference to Create/Read Text File. Why not be the first to post a comment about Sample to Use Scripting.FileSystemObject Reference to Create/Read Text File.