-
I'm not very familiar with NT. Well my boss and I were testing a program before we actually let anyone run it and we found that when we tried to save the .txt would not show up on the file name. Does anyone have any suggestions on to why that happened?
Thank you.
-
Post your saving routine. Maybe there's are error in it.
-
posted saving routine
Private Sub mnuFileSaveAs_Click()
Dim fname As String
Dim response As VbMsgBoxResult
On Local Error GoTo errhandler
CommonDialog1.CancelError = True
CommonDialog1.Filter = "Text (*.txt)|*.txt|" 'You can add other File Names here
CommonDialog1.ShowSave
Open CommonDialog1.FileName For Output As #1
Print #1, Text1.Text
Close #1
fname = CommonDialog1.FileName
If Len(Dir(fname)) > 0 Then
response = MsgBox("File already exists! Do you want to overwrite?", vbYesNo, "File Save As")
If (response = 7) Then
CommonDialog1.CancelError = True
CommonDialog1.Filter = "Text (*.txt)|*.txt|" 'You can add other File Names here
CommonDialog1.ShowSave
Open CommonDialog1.FileName For Output As #1
Print #1, Text1.Text
Close #1
End If
End If
errhandler:
Exit Sub
End Sub
-
Yeah I agree with the flags and they work great. Thanks.