Adding text to notepad file
Is there a way to add text into a notepad file without deleting what was already in the notepad file?
Right not im using this to add text to a notepad file.
Code:
Dim hFile As Long
Dim sFilename As String
sFilename = "c:\demo.txt"
hFile = FreeFile
Open sFilename For Output As #hFile
Print #hFile, Text1.Text
Close #hFile
The problem is that it overwrites the text already in the notepad file.
I cant store the text from the notepad file in a temporary textbox because theres too many characters in the notepad file and a textbox cannot fit it all.
Re: Adding text to notepad file
Code:
Open sFilename For Append As #hFile
Print #hFile, Text1.Text
Close #hFile
Re: Adding text to notepad file
FireXtol is exacly right. Instead of using Output, you use Append. This will just add text to the end of the notepad document.