Microsoft® Visual Basic® Scripting Edition CreateTextFile Method |
| Language Reference |
|
Creates a specified file name and returns a TextStream object that can be used to read from or write to the file.
[object.]CreateTextFile(filename[, overwrite[, unicode]])The CreateTextFile method has these parts:
Argument Description object Optional. Object is always the name of a FileSystemObject. filename Required. String expression that identifies the file to create. overwrite Optional. Boolean value that indicates whether you can overwrite an existing file. The value is True if the file can be overwritten, False if it can't be overwritten. If omitted, existing files are not overwritten. unicode Optional. Boolean value that indicates whether the file is created as a Unicode or ASCII file. The value is True if the file is created as a Unicode file, False if it's created as an ASCII file. If omitted, an ASCII file is assumed.
The following code illustrates how to use the CreateTextFile method to create and open a text file:If the overwrite argument is False, or is not provided, for a filename that already exists, an error occurs.Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("c:\testfile.txt", True) a.WriteLine("This is a test.") a.Close
file: /Techref/language/asp/vbs/vbscript/229.htm, 3KB, , updated: 1996/11/22 10:12, local time: 2024/11/21 13:24,
3.144.114.8:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/language/asp/vbs/vbscript/229.htm"> Microsoft® Visual Basic® Scripting Edition </A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.