title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
TextStream object |
vblr6.chm2181930 |
|
|
b1b78d3a-78b3-aee5-2efc-1e208e0858ac |
11/12/2018 |
medium |
Facilitates sequential access to file.
TextStream. { property | method }
The property and method arguments can be any of the properties and methods associated with the TextStream object. Note that in actual usage, TextStream is replaced by a variable placeholder representing the TextStream object returned from the FileSystemObject.
In the following code, a
is the TextStream object returned by the CreateTextFile method on the FileSystemObject; WriteLine and Close are two methods of the TextStream object.
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\testfile.txt", True)
a.WriteLine("This is a test.")
a.Close
Method | Description |
---|---|
Close | Closes an open TextStream file. |
Read | Reads a specified number of characters from a TextStream file and returns the result. |
ReadAll | Reads an entire TextStream file and returns the result. |
ReadLine | Reads one line from a TextStream file and returns the result. |
Skip | Skips a specified number of characters when reading a TextStream file. |
SkipLine | Skips the next line when reading a TextStream file. |
Write | Writes a specified text to a TextStream file. |
WriteBlankLines | Writes a specified number of new-line characters to a TextStream file. |
WriteLine | Writes a specified text and a new-line character to a TextStream file. |
Property | Description |
---|---|
AtEndOfLine | Returns true if the file pointer is positioned immediately before the end-of-line marker in a TextStream file, and false if not. |
AtEndOfStream | Returns true if the file pointer is at the end of a TextStream file, and false if not. |
Column | Returns the column number of the current character position in an input stream. |
Line | Returns the current line number in a TextStream file. |
- Objects (Visual Basic for Applications)
- Object library reference for Office (members, properties, methods)
[!includeSupport and feedback]