How to save the contents in a text box to a .txt file
-
- Posts: 137
- Joined: Sun Jan 30, 2005 7:32 am
- Location: Mississauga
How to save the contents in a text box to a .txt file
How to save the contents in a text box to a .txt file in a area of there computer that you get to choose, can any1 tell me how to do this kinda like this say your registering a product and u have to mail in the sheet so u type everything in u click the button and it saves the info in a txt file somewhere on your computer where u get to choose. How can i do so?
Signature exceeded 500x120 pixels.
-
- Posts: 115
- Joined: Fri Jan 14, 2005 9:26 am
- Location: Why The Fuck Would I Tell You? Indiana...
- Contact:
Type this in the command button (code):
(Change "Text1.Text" to the name of the textbox you have)
(Change "Text1.Text" to the name of the textbox you have)
Code: Select all
Dim Text As String
Open "C:\Documents and Settings\All Users\Desktop\Sample.txt" For Output As #1
Text = Text1.Text
Print #1, "This is whats contained in the Text1.Text Textbox: " + Text
Close #1
intMsg = MsgBox("File sample.txt Written")
Signature exceeded 75KB.
-
- Posts: 325
- Joined: Mon Mar 22, 2004 3:59 pm
- Location: Everywhere but nowhere
- Contact:
u would use 2 text opens and save with these one would have the location of the text file u want to move the other would have its contents
Save
_________________________
file = FreeFile
exe2 = example.Text
Open "C:\something.txt" For Output As #file
Print #file, exe2
Close #file
MsgBox "File Saved!", vbInformation, "Saved"
Open
______________________________________
file = FreeFile
Open "C:\something.txt" For Input As #file
exe2 = Input(LOF(file), 1)
Close #file
example2.Text = exe2
Save
_________________________
file = FreeFile
exe2 = example.Text
Open "C:\something.txt" For Output As #file
Print #file, exe2
Close #file
MsgBox "File Saved!", vbInformation, "Saved"
Open
______________________________________
file = FreeFile
Open "C:\something.txt" For Input As #file
exe2 = Input(LOF(file), 1)
Close #file
example2.Text = exe2
Sig breaks rules, read the rules before reposting.