Private Sub Save_As_Click()
VB Code:
  1. With CommonDialog1
  2.     .InitDir = "C:"
  3.     .FileName = ""
  4.     .Filter = "Text File (*.txt)|*.txt"
  5.     .DialogTitle = "Save file to:"
  6.     .ShowSave
  7.     on error goto CD_Error ' won't happen ever!
  8.     Open .FileName For Output Lock Read As #1
  9.         Print #1, Text1.Text & vbNullChar
  10.     Close #1
  11.  End With
  12.    exit sub  ' normal exit
  13. CD_Error:
  14.    on error goto 0 ' reset error trap
  15.    end with  ' close with
  16.    debug.print "Error in Save File!"
  17. End Sub     ' error exit

You can also use ON ERROR RESUME NEXT, but those are the hardest to debug properly.