use the Scripting.FileSystemObject, it has a CreateTextFile method which returns a TextStream object which you can use to write to the newly created file. Example from MSDN:
Sub CreateAfile
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("c:\testfile.txt", True)
MyFile.WriteLine("This is a test.")
MyFile.Close
End Sub
hth
Phil
|