It reads an entire line (up to, but not including, the newline character) from a TextStream file and returns the resulting string.
Syntax: strChars = objTso.ReadLine
objTso: (Required) The name of a TextStream Object previously instantiated.
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 two newlines. qfile.Writeline "Welcome to the World of QTP" qfile.Writeline "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 Msgbox qfile.ReadLine 'Output --> The file will be read line line by line. Loop 'Close the files. qfile.Close 'Release the allocated objects Set qfile=nothing Set fso=nothing