It writes a specified string to a TextStream file.
objTso: (Required) The name of a TextStream Object previously instantiated.
string: (Required) The text you want to write to the file.
Set fso=createobject("Scripting.FileSystemObject") 'Open the file "qtptest.txt" in writing mode. Set qfile=fso.OpenTextFile("C:qtptest.txt",2,True) 'write contents to the file into a single line. qfile.Write "Welcome to the World of QTP" qfile.Write "the file name is qtptest.txt" 'Open the file "qtptest.txt" in reading mode. Set qfile=fso.OpenTextFile("C:qtptest.txt",1,True) 'Read the entire contents of priously written file. Do while qfile.AtEndOfStream <> true 'Output --> The file will contain the above written content in single line. Msgbox qfile.ReadLine Loop 'Close the files. qfile.Close 'Release the allocated objects. Set qfile=nothing Set fso=nothing