PDA

Click to See Complete Forum and Search --> : how do i make my program make text files and save them?


Charlezz
Jan 3rd, 2000, 08:58 AM
I need to be able to save text files to file and access them later without using common dialogs, any code?

Clunietp
Jan 3rd, 2000, 09:05 AM
http://www.vb-world.net/ubb/Forum1/HTML/009246.html

Charlezz
Jan 3rd, 2000, 09:58 AM
yeah, but i meant WITHOUT using the common dialog control, but thanks any way

Clunietp
Jan 3rd, 2000, 11:39 AM
just read the part about opening the file for output and putting data into it, not the commondialog part. Are you looking for a way to display to the user something similar to the commondialog control?

Jan 3rd, 2000, 10:42 PM
You could use this code to save the file:


Private Sub Command1_Click()

Open YourFile.txt for Output as #1
Print #1, Text1.Text
Close #1

End Sub


And for opening the file, you could use...


Private Sub Command2_Click()

Open YourFile.txt for Input as #1
Text1.Text = Input(LOF(1),1)
Close #1

End Sub