TextStream

This objects controls the reading and writing to a text file

Dim objFSOFileSystemObject As Scripting.FileSystemObject 
Dim objFSOTextStream As Scripting.TextStream

Set objFSOFileSystemObject = New Scripting.FileSystemObject
Set objFSOTextStream = gobjFSOFileSystemObject.OpenTextFile("C:\Temp\", IOMode.ForAppending, True, TristateFalse)

gobjFSOTextStream.WriteLine ("line of text") gobjFSOTextStream.Close

gobjFSOTextStream.Close

Set objFSOFileSystemObject = Nothing
Set objFSOTextStream = Nothing

OpenTextFile(filename [,iomode][,create][,format])

filenamestrings expression of the file to open
iomodeIndicates whether input or output. Default is ForReading.
iomode.ForAppending (8) open the file and write to the end
iomode.ForReading (1) reading only no writing
iomode.ForWriting
createboolean to indicate whether a new file should be created if the filename does not exist. Default is False
formattristate to indicate the file format
Default is TriStateFalse
Tristate.TristateFalse (0) opens in ASCII
Tristate.TristateMixed
Tristate.TristateTrue (-1) opens as Unicode
Tristate.TristateUseDefault (-2) uses the system default.

WriteLine 
WriteBlankLines 
Close 
ReadAll 

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext