Private Sub mnuSave_Click()
CommonDialog1.Filter = "文本文档(*.txt)|*.txt|RTF文档(*.rtf)|*.rtf|所有文件(*.*)|*.*"
CommonDialog1.ShowSave
FileType = CommonDialog1.FileTitle
FiType = LCase(Right(FileType, 3))
Select Case FiType
Case "txt"
RichTextBox1.SaveFile CommonDialog1.filename, rtfText
Case "rtf"
RichTextBox1.SaveFile CommonDialog1.filename, rtfRTF
Case "*.*"
RichTextBox1.SaveFile CommonDialog1.filename
End Select
End Sub