我在存新檔的時候沒有popup save視窗?
存舊檔沒有問是否要over write,要怎麼樣它才會知道是新檔還是舊檔?最下面的MsgBox應該是錯的,在任何情況下都會跳出來‧
請大家幫幫忙‧
'儲存檔案
Private Sub mnuSave_Click()
CommonDialog1.Filter = "文字文檔(*.txt)!*.txt!RTF文檔(*.rtf)!*.rtf!所有檔案(*.*)!*.*"
FileType = CommonDialog1.FileTitle
FiType = LCase(Right(FileType, 3))
FileName = CommonDialog1.FileName
Select Case FiType
Case "txt"
RichTextBox1.SaveFile FileName, rtfText
Case "rtf"
RichTextBox1.SaveFile FileName, rtfRTF
Case "*.*"
RichTextBox1.SaveFile FileName
End Select
Me.Caption = "我的記事本:" & FileName
MsgBox "檔案已經存在,是否要覆蓋?", vbYesNo
End Sub
存舊檔沒有問是否要over write,要怎麼樣它才會知道是新檔還是舊檔?最下面的MsgBox應該是錯的,在任何情況下都會跳出來‧
請大家幫幫忙‧
'儲存檔案
Private Sub mnuSave_Click()
CommonDialog1.Filter = "文字文檔(*.txt)!*.txt!RTF文檔(*.rtf)!*.rtf!所有檔案(*.*)!*.*"
FileType = CommonDialog1.FileTitle
FiType = LCase(Right(FileType, 3))
FileName = CommonDialog1.FileName
Select Case FiType
Case "txt"
RichTextBox1.SaveFile FileName, rtfText
Case "rtf"
RichTextBox1.SaveFile FileName, rtfRTF
Case "*.*"
RichTextBox1.SaveFile FileName
End Select
Me.Caption = "我的記事本:" & FileName
MsgBox "檔案已經存在,是否要覆蓋?", vbYesNo
End Sub
請先 登入 以發表留言。