File Overwrite Problems 
Author Message
 File Overwrite Problems

Very new to VB6 and I'm trying to save  rich text to an existing rtf file
using FileSystemObject without overwriting what is already on the file. I am
also trying to leave a blank line in between entries for ease of reading.
Under the present condition it writes what's in the RichTextBox but
overwrites what was previously written. Any help would be appreciated.

Private Sub Command1_Click()
Dim fso As New FileSystemObject, fil As File, ts As TextStream

Set fso = CreateObject("Scripting.FileSystemObject")
Set fil = fso.GetFile("c:\ Data\" & sNam & "\" & sFil)
Set ts = fso.OpenTextFile("c:\ Data\" & sNam & "\" & sFil, ForWriting)
ts.WriteLine RichTextBox3.TextRTF
ts.WriteBlankLines (1)

Wed, 18 Jun 1902 08:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. File Overwrite Problems <-- VIRUS ATTACHED!

2. Problem: Reinstalling App - Setup doesn't overwrite files

3. Problems in distributing code- nasty overwrites cause problem

4. overwrite file?

5. writing to file without overwriting text already there?

6. overwrite file??

7. Problem: VB overwriting Access tables when it bails.

8. overwrite file??

9. Overwriting a file

10. Overwriting Exisiting Excel File w/SaveAs

11. File does not overwrite

12. Overwriting line in a text file


Powered by phpBB® Forum Software