officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-document-3fe72c45.md
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
string RtfText { get; set; }
Property RtfText As String
| Type | Description |
|---|---|
| String |
A string, containing the document’s content in rich text format.
|
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
BaseEdit editor = (BaseEdit)sender;
richEditControl.Document.RtfText = editor.EditValue.ToString();
}
word-processing-merge-documents-with-different-headers-and-footers/CS/Helpers/SectionsMerger.cs#L10
// Append document body
target.AppendRtfText(source.RtfText);
target.DifferentOddAndEvenPages = source.DifferentOddAndEvenPages;
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Import.cs#L20
\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
\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
// Import formatted text to the document.
document.RtfText = rtfString;
#endregion #ImportRtfText
winforms-grid-display-edit-rtf-data/VB/Form1.vb#L54
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
' Append document body
target.AppendRtfText(source.RtfText)
target.DifferentOddAndEvenPages = source.DifferentOddAndEvenPages
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Import.vb#L19
\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
\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
' Import formatted text to the document.
document.RtfText = rtfString
#End Region ' #ImportRtfText
See Also