Set filesys = CreateObject("Scripting.FileSystemObject")
Set a = filesys.createTextFile("C:\Documents and Settings\bobchiou\桌面" & "\_10X\" & Filename & "_8_2.tpl", True)
rec = 1
OO = ThisWorkbook.Sheets("Sheet1").Range("J3")
Do While I <= OO
AB = ThisWorkbook.Sheets("Sheet1").Cells(rec, 1).Value
CD = ThisWorkbook.Sheets("Sheet1").Cells(rec, 2).Value
EF = ThisWorkbook.Sheets("Sheet1").Cells(rec, 3).Value
GH = ThisWorkbook.Sheets("Sheet1").Cells(rec, 4).Value
IJ = ThisWorkbook.Sheets("Sheet1").Cells(rec, 5).Value
KL = ThisWorkbook.Sheets("Sheet1").Cells(rec, 6).Value
MN = ThisWorkbook.Sheets("Sheet1").Cells(rec, 7).Value
rec = rec + 1
I = rec
If I <= 11 Then
a.write AB & Chr(9) & CD & Chr(9) & EF & Chr(9) & GH & Chr(9) & IJ & Chr(9) & KL & Chr(9) & MN & Chr(10)
ElseIf I > 11 Then
a.write AB & Chr(10)
End If