Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

CopyPasteOptions.InsertOptions Property

Gets or sets options specifying how formatting is applied to pasted content.

Namespace: DevExpress.XtraRichEdit

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

Declaration

[DefaultValue(InsertOptions.MatchDestinationFormatting)]
public InsertOptions InsertOptions { get; set; }

Property Value

Type Default Description
InsertOptions **MatchDestinationFormatting**

An InsertOptions enumeration member indicating how formatting is applied to the formatted text inserted into a document.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to InsertOptions
WinForms Controls SnapControlOptions
.CopyPaste.InsertOptions
RichEditControlOptions
.CopyPaste.InsertOptions
WPF Controls RichEditControlOptions
.CopyPaste.InsertOptions
Office File API RichEditControlOptionsBase
.CopyPaste.InsertOptions

Remarks

Important

The InsertOptions property value is ignored when inserting to the document header or footer.

The table below shows how formatting is applied to the pasted document elements depending on the InsertOptions property value:

Enumeration Value

Direct Formatting

Styles (character, paragraph, table)

Non-textual objects (tables, floating objects, comments, etc.)

Page Properties and Tabs

InsertOptions.KeepSourceFormatting

The copied text retains its formatting.

New styles (styles that don’t exist in the target document) are copied. If character or paragraph style conflict occurs, all inserted style’s properties are applied as direct formatting, but the style itself is not transferred. Destination’s styles with default settings are substituted with inserted styles. Conflicted table and numbering list styles are copied to the document. The style name is a combination of conflicted styles’ names (e.g., Normal1 and Normal1 are combined into_Normal11_).

Non-textual elements are retained.

All page properties are retained.

InsertOptions.KeepTextOnly

The inserted text loses its formatting and takes on direct formatting applied to the target text range. Numbering lists are converted to simple text.

All inserted styles are not retained.

Floating objects, shapes and comments are discarded. Tables are converted into a series of paragraphs.

All page properties, including tabs, are lost.

InsertOptions.MergeFormatting

The inserted text retains the following character properties:

Other character properties and all paragraph properties are ignored.

Inserted style’s character properties are applied as direct, but the style itself is not copied to the target document. Style paragraph properties are ignored. Table styles are not retained. Numbering list styles are transferred to the target document.

Non-textual elements are retained.

Page properties are retained. Tabs are ignored.

InsertOptions.UseDestinationStyles

The copied text keeps its format options.

New styles (styles that don’t exist in the target document) are copied. If style conflict occurs, the inserted content’s styles are ignored. Destination’s styles with default settings are substituted with inserted styles.

Non-textual elements are retained.

All page properties are retained.

See Also