Property: Line for TextStream
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Properties > Property: Line for TextStream
Property: Line for TextStream
Specifies the current line number of the file pointer in a TextStream file. After the file is open, the property has the value 1.
Object.Line
| Object | TextStream Object with this property |
| Object.Line | LongInteger with read access |
The following example returns the number of lines in a file:
Function GetFileLines(sFile) Const ForReading = 1 Dim fso, oMyFile, sOutput Set fso = CreateObject("Scripting.FileSystemObject") Set oMyFile = fso.OpenTextFile(sFile, ForReading, False) sOutput = oMyFile.ReadAll GetFileLines = oMyFile.Line oMyFile.Close End Function