Anyone else get a type mismatch on the 'CreateTextFile'?
It works for 'OpenTextFile'
Code:
Private Sub Command1_Click()
Dim fso As New FileSystemObject
Dim f As File
Dim ts As TextStream
'Create a new file
Set f = fso.CreateTextFile("C:\test.txt")
Set ts = f.OpenAsTextStream(ForAppending)
ts.Write "TEST"
ts.Close
Set f = Nothing
Set ts = Nothing
End Sub
Thanks. I am well aware that the Open statement is an (often simpler) alternative.
I'm trying to find out whether or not FSO is working as it should.
FSO was created to provide specific advantages over the older file I/O statements and functions, the obvious one being object-oriented cababilities.
The 'simplicity' of my post was designed to focus on a specific feature/problem.
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET. subscribe