Implemented in version 3.0
([iomode [, format]])
This method opens a specified file and returns an instance of a
object that can then be manipulated - read from, written or appended to.
This method has two optional parameters. The first,
, has the following available values:
File is opened for reading only
File is opened for writing and the contents of any existing file with the same name are overwritten
Opens the file and writes to the end of any existing text.
The second optional parameter,
, can have any of the following values:
Uses the system default file format
Opens the file using the Unicode format
Opens the file in AscII format
dim filesys, demofile, txtstream
set filesys = CreateObject ("Scripting.FileSystemObject")
set demofile = filesys.CreateTextFile ("c:\somefile.txt", true)
set demofile = filesys.GetFile("c:\somefile.txt")
set txtstream = demofile.OpenAsTextStream (2, -2)
txtstream.Write "This will overwrite any text already in the file."
Copyright 1999-2004 by Infinite Software Solutions, Inc. All rights reserved.