Skip to main content

SubDocument.AppendRtfText(String, InsertOptions) Method

Appends formatted text.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

Declaration

DocumentRange AppendRtfText(
    string rtfText,
    InsertOptions insertOptions
)

Parameters

Name Type Description
rtfText String

A string containing data in RTF format.

insertOptions InsertOptions

An InsertOptions enumeration value, specifying how destination formatting is applied to appended content in certain cases.

Returns

Type Description
DocumentRange

A DocumentRange representing a range with appended content.

Remarks

The AppendRtfText method imports the specified string in RTF format into the internal document model.

After the string is successfully imported, the new document model is inserted at the end of the main document.

Use the InsertOptions.KeepSourceFormatting value for the insertOptions parameter if you observe that the last item in the numbered list is copied as a simple paragraph (not in the list) after insertion using the AppendRtfText method.

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).

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.

Note

If you want more control over the text before it is inserted, create an instance of the RichEditDocumentServer and load the string into it. Then use the SubDocument.AppendDocumentContent method to append the modified document.

See Also