"Type mismatch" error in JScript - newby question
- From: "KAREN27" <KAREN27@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 May 2005 20:53:01 -0700
Hi all,
I'm trying to create a simple text file that will allow a string of text to
be entered into it.
The script firstly creates the text file (which works well), but when I try
to then open that file for writing into it, I keep on getting a "type
mismatch" error. I'm very new to JScripting.
Here is the code:
<script language="JScript">
var fso = new ActiveXObject("Scripting.FileSystemObject");
var TheFile = fso.CreateTextFile("C:\\Test.txt", true); //creates the file,
and will overwrite if file already exists
var txtStream = fso.OpenTextFile(TheFile, 2, true); //opens the file for
writing
txtStream.WriteLine("Test Data to write");
</script>
Thanks very much for your help.
Karen
.
- Follow-Ups:
- Re: "Type mismatch" error in JScript - newby question
- From: Torgeir Bakken \(MVP\)
- Re: "Type mismatch" error in JScript - newby question
- Prev by Date: Re: Open window - staus bar
- Next by Date: Re: Passing Back Values to a Select control from window.opener.
- Previous by thread: How to download 2 files in one go
- Next by thread: Re: "Type mismatch" error in JScript - newby question
- Index(es):
Relevant Pages
|