Skip to main content

SubDocument.AppendDocumentContent(Stream, DocumentFormat) Method

Appends content from the stream.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation


DocumentRange AppendDocumentContent(
    Stream stream,
    DocumentFormat format


Name Type Description
stream Stream

A Stream representing a sequence of bytes interpreted as the content to append.

format DocumentFormat

A DocumentFormat enumeration specifying the format of the data contained in the stream.


Type Description

A DocumentRange representing a range with the appended content.


The AppendDocumentContent method loads the specified stream into the internal document model with the help of the specific importer.

After the stream is imported successfully, the new document model is inserted at the end of the main document.

The appended text starts with a new paragraph and preserves formatting. It is appended to an existing section and gets all section details (header, footer, page and print layout).

If the text being inserted contains document styles which are not present in the current document, the styles are copied to the resulting document.

If the document whose content is being inserted contains floating objects, such as pictures or text boxes, they are inserted into the corresponding positions in a newly created range.

When you pass the DocumentFormat.Undefined value as the format parameter, the inserted content’s format is determined automatically.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AppendDocumentContent(Stream, DocumentFormat) method.


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.

See Also