Hi all,
\n
\nI know how to save a single line to notepad, however, i want to save mutliple lines by entering For Next.
\n
\nHere is the code that i have:
\n
\r\n
Code:
\r\n
Dim FileNum As Integer, NewTxt As String, InputString As String, LineCount As Integer\nDim Number As Integer\n \nDataFile = "L:\\Fin_Services\\Exchequer S&D\\S&D Log Live\\New Folder\\1(1).txt"\nLineCount = 0\nCurDate = Format(Now, "ddmmyyyy")\nFileCount = 8\nFileNum = FreeFile \' next free filenumber\nOpen DataFile For Input As #FileNum\n\nWhile Not EOF(FileNum)\n \nLine Input #FileNum, InputString \' read a line from the textfile\nFor Number = 1 To FileCount\n\n \nNewTxt = "BCMS$" & CurDate & "$$IDXCRORB$SYSADM$Benefit-CMS Input DOC$f:\\dwpimports\\1(" & LineCount & ").pdf"\nLineCount = LineCount + 1\nNext Number\nWend\n \nClose #FileNum\n\nFileNum = FreeFile \' next free filenumber\nOpen DataFile For Append As #FileNum\n\n Print #FileNum, NewTxt\n Close #FileNum\r\n
This just overwrites one line with the new string.
\n
\nI think i have the For and Next in the wrong places.
\n
\nAny ideas?
\r\n \r\n\r\n