Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 2.76 KB

textstream-object.md

File metadata and controls

65 lines (47 loc) · 2.76 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
TextStream object
vblr6.chm2181930
vblr6.chm2181930
Office.TextStream
b1b78d3a-78b3-aee5-2efc-1e208e0858ac
11/12/2018
medium

TextStream object

Facilitates sequential access to file.

Syntax

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.

Remarks

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

Methods

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.

Properties

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.

See also

[!includeSupport and feedback]