Saves the contents of the RichTextBox to a specific type of file.


SaveFile( path, type )


path - The name and location of the file to save.

type - Optional. One of the RichTextBoxStreamType values. The default is RichText.

Return Value



The SaveFile method enables you to save the entire contents of the control to an RTF file that can be used by other programs such as Microsoft Word and Windows WordPad. If the file name that is passed to the path parameter already exists at the specified directory, the file will be overwritten without notice. You can use the LoadFile method to load the contents of a file into the RichTextBox.

The SaveFile method enables you to specify a file type to save the contents of the control to. You can use this feature to ensure that the file is saved in the proper format based on the contents of the control. For example, if your document has no differences in font style or coloring, you can save the file as an ASCII text file by setting the fileType parameter to plain text.

See Also

Applies To: RichTextBox

The CHM file was converted to HTML by chm2web software.