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




Reply With Quote