Back to Devexpress

Document.RtfText Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-document-3fe72c45.md

latest6.4 KB
Original Source

Document.RtfText Property

Gets or sets the formatted text content of the document.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
string RtfText { get; set; }
vb
Property RtfText As String

Property Value

TypeDescription
String

A string, containing the document’s content in rich text format.

|

Remarks

Use the following methods to save the document in RTF format:

The SubDocument.GetRtfText method retrieves the specified range in the RTF format.

The following code snippets (auto-collected from DevExpress Examples) contain references to the RtfText property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-grid-display-edit-rtf-data/CS/Form1.cs#L63

csharp
BaseEdit editor = (BaseEdit)sender;
    richEditControl.Document.RtfText = editor.EditValue.ToString();
}

word-processing-merge-documents-with-different-headers-and-footers/CS/Helpers/SectionsMerger.cs#L10

csharp
// Append document body
target.AppendRtfText(source.RtfText);
target.DifferentOddAndEvenPages = source.DifferentOddAndEvenPages;

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Import.cs#L20

csharp
\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs32 Test.\cf0\b0\f1\fs20\par}";
            document.RtfText = rtfString;
            #endregion #ImportRtfText

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/ImportActions.cs#L20

csharp
\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs32 Test.\cf0\b0\f1\fs20\par}";
            document.RtfText = rtfString;
            #endregion #ImportRtfText

word-document-api-examples/CS/CodeExamples/ImportActions.cs#L31

csharp
// Import formatted text to the document.
document.RtfText = rtfString;
#endregion #ImportRtfText

winforms-grid-display-edit-rtf-data/VB/Form1.vb#L54

vb
Dim editor As BaseEdit = CType(sender, BaseEdit)
    richEditControl.Document.RtfText = editor.EditValue.ToString()
End Sub

word-processing-merge-documents-with-different-headers-and-footers/VB/Helpers/SectionsMerger.vb#L11

vb
' Append document body
target.AppendRtfText(source.RtfText)
target.DifferentOddAndEvenPages = source.DifferentOddAndEvenPages

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Import.vb#L19

vb
\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs32 Test.\cf0\b0\f1\fs20\par}"
            document.RtfText = rtfString
#End Region ' #ImportRtfText

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/ImportActions.vb#L17

vb
\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs32 Test.\cf0\b0\f1\fs20\par}"
            document.RtfText = rtfString
' #End Region ' #ImportRtfText

word-document-api-examples/VB/CodeExamples/ImportActions.vb#L29

vb
' Import formatted text to the document.
            document.RtfText = rtfString
#End Region ' #ImportRtfText

See Also

Text

Document Interface

Document Members

DevExpress.XtraRichEdit.API.Native Namespace