Newbie Q - File saving.

Ok,  I'm very new to VB, and I have  a simple question:  How do you save the contects of a textbox (which is in turn assigned to a variable) to disk?  I understand how to assign variables, open the common dialog and all that, but I don't seem to understand how to simply write the contents of a text box to disk!  Strangely, neither of the "learning edition" books I got with VB 6 explains this, aside from how to open the common dialog for loading and saving.

In essence, what I'm trying to do is have a screen of textboxes that the user fills out, and can then save as a sort of "preferences" file, so that they can simply reload them next time without having to enter it all in again.

If anyone could explain this, or give me a reference to where to look for an answer, I'd appreciate it.



Who is Participating?
caraf_gConnect With a Mentor Commented:
Dim intFile As Integer
intFile = FreeFile

'Clear out previous data
Open strFile For Output As #intFile
Close #intFile


'Write big string
intFile = FreeFile
Open strFile For Binary As #intFile

'Note the two commas!
Put #intFile,,Text1.Text

Close #intFile


Please reject this answer and ask Customer Service to delete this question. First of all you posted the question twice, but also I think that the direction the duplicate thread is taking is altogether more promising to get you a solution...
All Courses

From novice to tech pro — start learning today.