Skip to main content

SubDocument.AppendDocumentContent(DocumentRange) Method

Appends content from the specified range.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.1.Core.dll

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

Declaration

DocumentRange AppendDocumentContent(
    DocumentRange range
)

Parameters

Name Type Description
range DocumentRange

A DocumentRange to append.

Returns

Type Description
DocumentRange

A DocumentRange representing a range with the appended content.

Remarks

The AppendDocumentContent method inserts the specified document range 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).

When the content being inserted is divided into sections, the inserted and destination sections interact as follows:

  • If the content is inserted into an empty document, all inserted section properties are retained.
  • If the content is inserted into a document divided into sections, all but the last inserted sections retain their parameters. The last section takes on the destination section’s options.
  • If the content is inserted after a section break, both destination and inserted sections retain their properties.

If the content is copied without section properties (the last section’s paragraph is not included), the destination section’s settings stay intact after insertion.

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

The content’s floating objects, such as pictures or text boxes, are inserted into the corresponding positions in a newly created range. The Shape.Range property of a floating object determines whether it falls within the range being inserted and will therefore be added to the resulting document.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AppendDocumentContent(DocumentRange) 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.

See Also