Dim d As DialogResult sfd1.Filter = "Texte (*.txt)|*.txt|Texte (*.doc)|*.doc|Texte (*.rtf)|*.rtf" sfd1.FilterIndex = 0 d = sfd1.ShowDialog If d = DialogResult.OK Then Select Case sfd1.FilterIndex Case 0 RichTextBox1.SaveFile(sfd1.FileName) ' exemple| >> ton code Case 1 RichTextBox1.SaveFile(sfd1.FileName) ' exemple| >> ton code Case 2 RichTextBox1.SaveFile(sfd1.FileName) ' exemple| >> ton code End Select End If
CommonDialog1.Filter = "HTML Files (*.html)|*.html|HTM Files (*.htm)|*.htm)" CommonDialog1.ShowSave If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName For Output As #1 Print #1, RichTextBox1.Text Close #1 End If