This example displays a dialog box to choose an .rtf file to which you will save the contents of a RichTextBox control. To try this example, put a RichTextBox control, a CommandButton control, and a CommonDialog control on a form. Paste this code into the Click event of the CommandButton control. Then run the example.
Private Sub Command1_Click()
CommonDialog1.ShowSave
RichTextBox1.SaveFile CommonDialog1.Filename, rtfRTF
End Sub