Back to Devexpress

RichEditDocumentServer.CreateNewDocument(Boolean) Method

officefileapi-devexpress-dot-xtrarichedit-dot-richeditdocumentserver-dot-createnewdocument-x28-system-dot-boolean-x29.md

latest3.6 KB
Original Source

RichEditDocumentServer.CreateNewDocument(Boolean) Method

Creates a new blank document.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public virtual bool CreateNewDocument(
    bool raiseDocumentClosing = false
)
vb
Public Overridable Function CreateNewDocument(
    raiseDocumentClosing As Boolean = False
) As Boolean

Optional Parameters

NameTypeDefaultDescription
raiseDocumentClosingBooleanFalse

true to raise the RichEditDocumentServer.DocumentClosing event before creating a new document; otherwise false.

|

Returns

TypeDescription
Boolean

true to create a new document; otherwise false.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateNewDocument(Boolean) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

word-document-api-examples/CS/CodeExamples/BasicActions.cs#L20

csharp
// Create a new blank document.
wordProcessor.CreateNewDocument();
#endregion #CreateDocument

winforms-richedit-layout-api/CS/Form1.cs#L101

csharp
RichEditDocumentServer srv = new RichEditDocumentServer();
srv.CreateNewDocument();
srv.Document.AppendDocumentContent(richEditControl1.Document.Selection);

word-document-api-examples/VB/CodeExamples/BasicActions.vb#L24

vb
' Create a new blank document.
            wordProcessor.CreateNewDocument()
#End Region ' #CreateDocument

winforms-richedit-layout-api/VB/Form1.vb#L83

vb
Dim srv As New RichEditDocumentServer()
srv.CreateNewDocument()
srv.Document.AppendDocumentContent(richEditControl1.Document.Selection)

Implements

CreateNewDocument(Boolean)

See Also

RichEditDocumentServer Class

RichEditDocumentServer Members

DevExpress.XtraRichEdit Namespace