Sub CreateTxtFile()
Dim myFileSystemObject As FileSystemObject
Dim aFile As TextStream
Set myFileSystemObject = New FileSystemObject
Set aFile = myFileSystemObject.CreateTextFile("C:\myFile.txt", True)
aFile.WriteLine
aFile.Write ("asdf") 'Write tab-delimited text
aFile.Close 'Close file and clear memory
Set myFileSystemObject = Nothing
Set aFile = Nothing
End Sub
|