The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

SubDocument.InsertText(DocumentPosition, String) Method

Inserts the specified text at the specified position.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

DocumentRange InsertText(
    DocumentPosition pos,
    string text
)
Function InsertText(
    pos As DocumentPosition,
    text As String
) As DocumentRange
DocumentRange InsertText(
    DocumentPosition pos,
    string text
)
Function InsertText(
    pos As DocumentPosition,
    text As String
) As DocumentRange
DocumentRange InsertText(
    DocumentPosition pos,
    string text
)
Function InsertText(
    pos As DocumentPosition,
    text As String
) As DocumentRange

Parameters

Name Type Description
pos DocumentPosition

A DocumentPosition object specifying the position at which the text should be inserted.

text String

A String value specifying the text to insert.

Parameters

Name Type Description
pos DocumentPosition

A DocumentPosition object specifying the position at which the text should be inserted.

text String

A String value specifying the text to insert.

Parameters

Name Type Description
pos DocumentPosition

A DocumentPosition object specifying the position at which the text should be inserted.

text String

A String value specifying the text to insert.

Returns

Type Description
DocumentRange

A DocumentRange object representing the DocumentRange.Start and DocumentRange.End positions of the inserted text.

Returns

Type Description
DocumentRange

A DocumentRange object representing the DocumentRange.Start and DocumentRange.End positions of the inserted text.

Returns

Type Description
DocumentRange

A DocumentRange object representing the DocumentRange.Start and DocumentRange.End positions of the inserted text.

Remarks

Consider using the SubDocument.InsertSingleLineText method instead of InsertText for inserting text without line breaks. This can enhance performance.

Examples

document.AppendText("ABCDEFGH");
DocumentRange r1 = document.CreateRange(1, 3);
DocumentPosition pos1 = document.CreatePosition(2);
DocumentRange r2 = document.InsertText(pos1, ">>NewText<<");
string s1 = String.Format("Range r1 starts at {0}, ends at {1}", r1.Start, r1.End);
string s2 = String.Format("Range r2 starts at {0}, ends at {1}", r2.Start, r2.End);
document.Paragraphs.Append();
document.AppendText(s1);
document.Paragraphs.Append();
document.AppendText(s2);
See Also