In the following code, a is the TextStream object returned by the CreateTextFile method on the FileSystemObject:
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile= fso.CreateTextFile("c:\testfile.txt", True)
MyFile.WriteLine("This is a test.")
MyFile.Close
WriteLine and Close are two methods of the TextStream Object.