New to Telerik Document ProcessingStart a free 30-day trial

Insert Documents

Updated on May 11, 2026

With RadWordsProcessing, you have the ability to insert a document into another document at specified position.

Inserting Documents at a Specific Position

You could merge documents at a specific position using the InsertDocument() method of the RadFlowDocumentEditor class. When called, this method inserts the source document at the current editor position.

  • public void InsertDocument(RadFlowDocument sourceDocument)

  • public void InsertDocument(RadFlowDocument sourceDocument, InsertDocumentOptions insertOptions)

The InsertDocumentOptions class contains the following options to control the insert behavior:

PropertyDescription
ConflictingStylesResolutionModeOf type ConflictingStylesResolutionMode. Determines how conflicts between styles are resolved (rename the source style or keep the target settings). Default: RenameSourceStyle.
InsertLastParagraphMarkerDetermines whether the last paragraph marker (last paragraph formatting symbol) should be inserted. If true, a new paragraph with the same formatting is inserted. If false, only the inlines from that paragraph are inserted. Default: true.

Example 1 demonstrates how to use the InsertDocument() method.

Example 1: Insert source document into target document

C#
InsertDocumentOptions options = new InsertDocumentOptions();
options.ConflictingStylesResolutionMode = ConflictingStylesResolutionMode.UseTargetStyle;
options.InsertLastParagraphMarker = true;

RadFlowDocumentEditor editor = new RadFlowDocumentEditor(targetDocument);
editor.InsertDocument(sourceDocument, options);

Behavior

Table 1 lists some scenarios where the InsertDocument() method could be used.

Table 1

ActionResult
Insert the source document in an empty document (without any sections).All of the content of the source document will be inserted in the target one. The section properties will be obtained from the source document.
Insert the source document between runs. Source document contains a single section.All of the blocks (Paragraphs and Tables) in the source document’s section will be inserted at the specific location. The section properties will be omitted. This means if the target document page orientation is portrait and the source is landscape, the result document will have portrait orientation.
Insert the source document between runs. Source document contains multiple sections.All of the blocks in the source document’s first section will be inserted at the current editor position. All the next sections from the source document will be inserted as separate sections. The last section in the result document will have section properties of the section from the target document where the editor position is when the InsertDocument() method is invoked.
Insert the source document at the beginning of the target document. Source document contains single section.All of the blocks in the source document’s section will be inserted at the specific location. The section properties will be omitted. This means if the target document page orientation is portrait and the source is landscape, the result document will have portrait orientation.
Insert the source document at the beginning of the target document. Source document contains multiple sections.All of the blocks in the source document’s first section will be inserted at the specific location. The whole next sections from the source document will be inserted as separate sections. The last section in the result document will have section properties of the insert target section.
Insert the source document at the end of the target document. Source document contains single section.All of the blocks in the source document’s section will be inserted at the specific location. The section properties will be omitted. This means if the target document page orientation is portrait and the source is landscape, the result document will have portrait orientation.
Insert the source document at the end of the target document. Source document contains multiple sections.Same as the above.
Insert the source document in a table cell and the source document contains multiple sections.An InvalidOperationException is thrown.
Source document contains no Sections.An ArgumentException is thrown.

See Also