AtEndOfStream property
If the file pointer is locatedTextStreamAt the end of the file, returnTrue; otherwise, if not read-only, returnFalse。
object.AtEndOfStream
object should be the name of the TextStream object.
illustrate
AtEndOfStreamProperties are only used for open read-onlyTextStreamfile, otherwise an error will occur.
The following code shows how to use itAtEndOfStreamproperty:
Function ReadEntireFile(filespec) Const ForReading = 1 Dim fso, theFile, retstring Set fso = CreateObject("") Set theFile = (filespec, ForReading, False) Do While theFile.AtEndOfStream <> True retstring = Loop ReadEntireFile = retstringEnd Function