officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-subdocument-dot-insertdocumentcontent-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-documentposition-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-documentrange-x29.md
Inserts content from the specified range in the current document at the specified position.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
DocumentRange InsertDocumentContent(
DocumentPosition pos,
DocumentRange range
)
Function InsertDocumentContent(
pos As DocumentPosition,
range As DocumentRange
) As DocumentRange
| Name | Type | Description |
|---|---|---|
| pos | DocumentPosition |
A DocumentPosition specifying the position in the current document, after which content is inserted.
| | range | DocumentRange |
A DocumentRange representing the source range for insertion.
|
| Type | Description |
|---|---|
| DocumentRange |
A DocumentRange representing the document range with inserted content.
|
The InsertDocumentContent method inserts the specified document range at the specified position of the main document.
The inserted text starts with a new paragraph and preserves formatting. It is inserted 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 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.
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. 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.
See Also