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:
  1. Private Sub Command1_Click()
  2.     cdl.Filter = "App File|*.smd"
  3.     cdl.InitDir = "C:\Test.Txt"
  4.     cdl.ShowSave
  5.     If Len(cdl.FileName) = 0 Then Exit Sub
  6. Close
  7.     Open cdl.FileName For Binary As #1
  8.     Put #1, , txtTest.Text
  9.     Close #1
  10. 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