Name
OpenAsTextStream (File Object) —
tsObject =
filObj
.OpenAsTextStream [
intAccessMode
][,
intFormat
]
Synopsis
Opens a file and creates a TextStream object that you can use to read or modify the text file. The method returns a TextStream object.
Parameters
-
intAccessMode An integer that indicates the input/output mode in which you wish to open the text file. Possible values for this parameter are as follows:
|
Constant |
Value |
Description |
|---|---|---|
|
|
1 |
The file will be opened as read-only and cannot be modified by the current TextStream object. |
|
|
2 |
The file will be opened for writing. If the file already exists when you call the OpenAsTextStream method, the original file is overwritten. |
|
|
8 |
The file is opened for appending only. You can only add characters to the end of this file. |
-
intFormat An integer that indicates the format of the file to be opened as a TextStream object. The possible values for this parameter are thought of as a single tristate value. The file is Unicode, ASCII, or whichever is the system default. Possible values for this parameter are:
|
Constant |
Value |
Description |
|---|---|---|
|
|
-2 |
The file format will be the same as the default for the web server (Unicode or ASCII). |
|
|
-1 |
The file format will be Unicode. |
|
|
0 |
The file format will be ASCII. |
Example
<% ' Dimension local variables. Dim fsoObject ' FileSystemObject Dim filObject ' File Object Dim tsObject ' TextStream object ' Declare ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access