Okay;
I have two files. File one contains header info. File two contains 8 records (13 lines per record).
I need to append the contents of "Kronos.txt(file two) into Header.txt(file one). I have never used filesystemobject or textstream before. Can someone tell me what I am doing wrong here or am I going about this the wrong way?
Thanks
Public sub OpenMe()
Dim mystr1 As String
Dim FileSystemObject, TextStream As Object, tStream As Object
Set FileSystemObject = CreateObject("Scripting.FileSystemObject")
Set TextStream = FileSystemObject.createtextfile("c:\testing\kronos.txt")
Set TextStream = FileSystemObject.OpenTextFile("c:\testing\kronos.txt, ForAppending")
Set tStream = FileSystemObject.createtextfile("c:\testing\header.txt")
Set tStream = FileSystemObject.OpenTextFile("c:\testing\header.txt, ForReading")
Do While Not EOF(2)
mystr1 = TextStream.readline
tStream.Writeline = mystr1
Loop
End sub




Reply With Quote