Monday, August 26, 2013

Read File as String - QTP


Function ReadAFileAsString (pathWithName)

  Set fso=createobject("Scripting.FileSystemObject")
  'Open the file in writing mode.
  Set qfile=fso.OpenTextFile(pathWithName, 1, True)
  ReadAFileAsString  = qfile.ReadAll 
 
  Set qfile = Nothing
  Set fso = Nothing

End Function

No comments:

Post a Comment