You can load and save files in 2 different formats; RTF and Plain Text. To load a file use the following syntax:
RichTextBox1.LoadFile FilePath, Format
Where format is either the constant rtfRTF (Rich Text Format) or rtfText (Plain Text).
RichTextBox1.LoadFile "C:Document1.rtf", rtfRTF
Loads C:Document1.rtf into RichTextBox1 in RTF
To Save a file use the following syntax:
RichTextBox1.SaveFile FilePath, Format
So
RichTextBox1.SaveFile RichTextBox1.Filename, rtfRTF
This saves the current file in RTF. RichTextBox1.Filename stores the current files path.
Comments