已解决了
分享下源代码,请高手们指点下是否有误...
Private Sub FileSave_Click()
If bFirstSave = True Then
er:
CommonDialog1.FileName = ""
CommonDialog1.ShowSave
strPath = CommonDialog1.FileName
If strPath <> "" Then
If Dir(strPath) <> "" Then
If MsgBox(strPath & "此路径已存在是否要替代它!", vbYesNo + 64, "提示") = vbYes Then
Call sName
Open strPath For Output As #1
Print #1, Text1.Text
Close #1
bFirstSave = False
Form1.Caption = strName & " - 记事本"
Else
GoTo er
End If
Else
Call sName
If strPath <> "" Then
Open strPath For Output As #1
Print #1, Text1.Text
Close #1
bFirstSave = False
Form1.Caption = strName & " - 记事本"
End If
End If
End If
Else
Open strPath For Output As #1
Print #1, Text1.Text
Close #1
End If
End Sub