This example saves the entire contents of a RichTextBox control to an .rtf file. To try this example, put a RichTextBox control and a CommandButton control on a form. Paste this code into the Click event of the CommandButton control. Then run the example.
Private Sub Command1_Click ()
Open "mytext.rtf" For Output As 1
Print #1, RichTextBox1.TextRTF
Close 1
End Sub