By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,039 Members | 1,831 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,039 IT Pros & Developers. It's quick & easy.

problems with OpenTextFile

P: n/a
In the following example code some thing is wrong:
<<<<<<<<<<
Sub OpenTextFileTest
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("c:\testfile.txt",
ForAppending,TristateFalse)
f.Write "Hello world!"
f.Close
End Sub
>>>>>>>>>

First of all, it seems, one argument is missing, should be
...ForAppending, true, TristateFalse)...
according to Syntax.

Anyway, I was trying many ways, this constructions didn't work, runtime
error 5 was coming.
Hereby TristateFalse was always empty.
Any suggestions?
--
V.Moltchanov

Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.