C
Cez
Hi guys,
I am a new developer in MS Access and is currently working on a requirement
which needs for me to combine several text files into one RTF file. So far,
I have these codes:
Dim fileRTF As String
Dim pathApp As String
Dim TextLine As String
pathApp = CurrentProject.Path
fileRTF = pathApp & "\transactionreports.rtf"
DoCmd.OutputTo acOutputReport, "Report1", acFormatRTF, pathApp &
"\transaction1.rtf", False
DoCmd.OutputTo acOutputReport, "Report2", acFormatRTF, pathApp &
"\transaction2.rtf", False
DoCmd.OutputTo acOutputReport, "Report3", acFormatRTF, pathApp &
"\transaction3.rtf", False
DoCmd.OutputTo acOutputReport, "Report4", acFormatRTF, pathApp &
"\transaction4.rtf", False
Open fileRTF For Output Access Write As #1
Open pathApp & "\transaction1.rtf" For Input As #2
Do While Not EOF(2)
Line Input #2, TextLine
Print #1, TextLine
Loop
Close #2
Open pathApp & "\transaction2.rtf" For Input As #3
Do While Not EOF(3)
Line Input #3, TextLine
Print #1, TextLine
Loop
Close #3
With these codes, I didn't have error, four RTF files were created. However
the output file only contains the first file transaction1.rtf. I tried to
trace it, and the program runs the second loop, too, and yet when i opened
the output file only contains the first text file.
Is there something I miss here? Do we have a special function to append to
an existing file?
Any input will be great. Thanks in advance...
I am a new developer in MS Access and is currently working on a requirement
which needs for me to combine several text files into one RTF file. So far,
I have these codes:
Dim fileRTF As String
Dim pathApp As String
Dim TextLine As String
pathApp = CurrentProject.Path
fileRTF = pathApp & "\transactionreports.rtf"
DoCmd.OutputTo acOutputReport, "Report1", acFormatRTF, pathApp &
"\transaction1.rtf", False
DoCmd.OutputTo acOutputReport, "Report2", acFormatRTF, pathApp &
"\transaction2.rtf", False
DoCmd.OutputTo acOutputReport, "Report3", acFormatRTF, pathApp &
"\transaction3.rtf", False
DoCmd.OutputTo acOutputReport, "Report4", acFormatRTF, pathApp &
"\transaction4.rtf", False
Open fileRTF For Output Access Write As #1
Open pathApp & "\transaction1.rtf" For Input As #2
Do While Not EOF(2)
Line Input #2, TextLine
Print #1, TextLine
Loop
Close #2
Open pathApp & "\transaction2.rtf" For Input As #3
Do While Not EOF(3)
Line Input #3, TextLine
Print #1, TextLine
Loop
Close #3
With these codes, I didn't have error, four RTF files were created. However
the output file only contains the first file transaction1.rtf. I tried to
trace it, and the program runs the second loop, too, and yet when i opened
the output file only contains the first text file.
Is there something I miss here? Do we have a special function to append to
an existing file?
Any input will be great. Thanks in advance...