Name

Stream.WriteText Method — (Versions 2.5, 2.6)

Synopsis

stream.WriteText Data, Options
                  

The WriteText method writes a number of bytes to a binary stream.

Arguments

Data (String)

Represents the String data to be written to the Stream object.

Options (StreamWriteEnum)

Optional. Indicates whether just the data is written to the Stream object or if the data and a line separator (indicated by the LineSeparator property) are added to the Stream object. The default is not to add the line separator.

Description

After writing the specified string to the Stream object, the Position property is set to the next character following the last character written. If there is existing data past the end of what has been written, it is not truncated. If you want to truncate this data, call the SetEOS method.

If the written data exceeds the length of the Stream object, the new data is appended to the Stream object, the length of the stream is increased, and the EOS pointer is moved to the new end of the stream.

The WriteText method is used to write to text streams (Stream.Type property is equal to adTypeText), while the Write method is used to write binary streams (Stream.Type property is equal to adTypeBinary).

See Also

Stream.EOS Property, Stream.SetEOS Method, Stream.Type Property, Stream.WriteText Method, StreamWriteEnum Enumeration

Get ADO: ActiveX Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.