suoirotciv
Programmer
Good day,
The given code below is working.
But my problem is when i open the text file and go to the last line, there was additional row instead of showing only the "SetFooter". It was like I hit the enter key.
How can I avoid that last line.
======= SAMPLE ONLY (MY PROBLEM) ========
01234567891
01234567892
01234567893
9876543210
===================================
======= SAMPLE ONLY (SHOULD BE) =========
01234567891
01234567892
01234567893
9876543210
===================================
========================================
I kept my Job because of TEK-TIPS
Thanks a lot to all who keeps on helping others.
The given code below is working.
But my problem is when i open the text file and go to the last line, there was additional row instead of showing only the "SetFooter". It was like I hit the enter key.
How can I avoid that last line.
======= SAMPLE ONLY (MY PROBLEM) ========
01234567891
01234567892
01234567893
9876543210
===================================
======= SAMPLE ONLY (SHOULD BE) =========
01234567891
01234567892
01234567893
9876543210
===================================
Code:
Dim NewTextFile As Object, fso As Object
Dim TextFileName As String
Dim SetFooter As String
Dim SetDetails As String
Dim LoopRec as Integer
Const ForWriting = 2
Set fso = CreateObject("Scripting.FileSystemObject")
Set NewTextFile = fso.OpenTextFile(TextFileName, ForWriting, True)
For LoopRec = 1 to 3
SetDetails = "0123456789" & LoopRec
NewTextFile.writeline SetDetails
Next LoopRec
SetFooter = "9876543210"
NewTextFile.writeline SetFooter
========================================
I kept my Job because of TEK-TIPS
Thanks a lot to all who keeps on helping others.