Sample to Use Scripting.FileSystemObject Reference to Create/Read Text File
Sample to Use Scripting.FileSystemObject Reference to Create/Read Text File
API Declarations
Dim fso As FileSystemObject
Dim f As TextStream
Rate Sample to Use Scripting.FileSystemObject Reference to Create/Read Text File
(1(1 Vote))
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
Sample to Use Scripting.FileSystemObject Reference to Create/Read Text File Comments
No comments yet — be the first to post one!
Post a Comment