Amending a File

 

When creating certain applications, you will want to be able to
create a log of the tasks. This code opens test.txt and adds a
entry to the end of a file.

============================================================
Dim nFileNum As Integer

' Get a free file number
nFileNum = FreeFile

' Open Test.txt for append
Open App.Path & "\test.txt" For Append As nFileNum

' Add the contents of TextBox1 to Test.txt
Print #nFileNum, TextBox1.Text

' Close the file
Close nFileNum