How to: Create a New Document with the RichEditControl
The RichEditControl.CreateNewDocument method is used to create a new document in the RichEditControl. The CreateEmptyDocumentCommand command associated with the CTRL-N key combination is also used for this purpose.
The RichEditControl.EmptyDocumentCreated event is raised after a new document is created.
Tip
A complete sample project is available in the DevExpress Code Examples database at https://supportcenter.devexpress.com/ticket/details/e1398/how-to-specify-default-document-formatting.
Note
You can set the RichEditControl.Text property to an empty string to clear the control’s content.
The Document.DefaultCharacterProperties and the Document.DefaultParagraphProperties properties enable you to specify default formatting for the newly created document.
You can also use the RichEditControl.LoadDocumentTemplate method to load a document and leave the DocumentSaveOptions.CurrentFileName and the DocumentSaveOptions.CurrentFormat intact. Thus, the document will not be automatically overwritten if the SaveDocumentCommand command is executed or the RichEditControl.SaveDocument is called. An attempt to save a document that was loaded as a template invokes the Save As… dialog, which enables the end-user to specify a different file name and format.