|
-
Jul 6th, 2005, 06:37 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Saving textbox text to a file WITHOUT user clicking.
Hello,
Is there anyway for me to get my program to just save my textbox text to a txt file without the user having to enter a filename and click on save?
Example.
Right now I am using this code.
But as you can see it requires the user to enter a file name and click save.
My form has the commponent Microsoft Common Dialog Control (Named cdl)
a textbox (Named txtTest.txt)
and a command button
VB Code:
Private Sub Command1_Click()
cdl.Filter = "App File|*.smd"
cdl.InitDir = "C:\Test.Txt"
cdl.ShowSave
If Len(cdl.FileName) = 0 Then Exit Sub
Close
Open cdl.FileName For Binary As #1
Put #1, , txtTest.Text
Close #1
End Sub
Is there any way to change this so that it is auto save when the user clicks the command button. Also I would want the program to save the text to the txt file without deleteing what is already in the file. So it would just add it on in a new line.
Thank you all!
Stilekid007
 Originally Posted by stilekid007
-
Jul 6th, 2005, 06:41 PM
#2
Re: Saving textbox text to a file WITHOUT user clicking.
VB Code:
Open "C:\some filename that you cant change since you want to remove the common dialog.smd" For Append As #1
Print #1,txtTest.Text
Close #1
Has someone helped you? Then you can Rate their helpful post. 
-
Jul 6th, 2005, 06:50 PM
#3
Thread Starter
Hyperactive Member
Re: Saving textbox text to a file WITHOUT user clicking.
Thanks man! That did it perfect!
Stilekid007
 Originally Posted by stilekid007
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|