I don't see the good point having textbox containing the file content. Textboxes can't contain any nullchars (chr(0)) so you will probably have it corrupted if you put something that's not formatted as plain text. Here's the fast way to get your file as a string property:
Code:Property Get File(Filename As String) As String Dim fnum As Byte fnum = FreeFile Open Filename For Binary As fnum File = Space(LOF(fnum)) Get #fnum, , File Close fnum End Property Property Let File(Filename As String, textstring As String) Dim fnum As Byte If Dir(Filename) <> "" Then Kill Filename fnum = FreeFile Open Filename For Binary As fnum Put #fnum, , textstring Close fnum End Property





Reply With Quote