I got the code below from the Mircosoft Site to work with text files. I am getting errors that make me think I need to set a reference to use this but am unable to find one. Any idea what reference I set??
Dim fso As New FileSystemObject, txtfile, _
fil1 As File, ts As TextStream
fso.CreateTextFile "c:\testfile.txt", True
MsgBox "Writing file"
' Write a line.
Set fil1 = fso.GetFile("c:\testfile.txt")
Set ts = fil1.OpenAsTextStream(ForWriting)
ts.Write "Hello World"
' Read the contents of the file.
Set ts = fil1.OpenAsTextStream(ForReading)
s = ts.ReadLine