I am, with this code, just finishing the work you, and the others, have done. Plus adding some new procedures, and so on. I hope you will enjoy the code! :-)
Private Sub Command1_Click()
' Shows the Common Dialog control
CommonDialog1.InitDir = "c:\"
CommonDialog1.Filter = "All files(*.*) | *.*|text files(*.txt)|*.txt"
CommonDialog1.FilterIndex = 2
CommonDialog1.ShowSave
' If the user press 'cancel'
If Len(CommonDialog1.FileName) < 1 Then
Exit Sub
End If
' Save the current text (in this case Text1 is the current text)
Dim Filename As String
FileName = CommonDialog1.FileName
' This line is NOT a Visual Basic command, but
' A self-made procedure!
SaveFile CommonDialog1.FileName, Text1.Text
Me.Caption = "File Saved"
End Sub
Public Sub SaveFile(Where As String, What As String)
Open Where For Output As #5
Print #5, What
Close #5
End Sub
Written by NorthCode .:. NorthCode@e-mail.dk |
www.NorthCode.tk