officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-comment-bb94d74c.md
Specifies the document range to which the comment relates.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
DocumentRange Range { get; }
ReadOnly Property Range As DocumentRange
| Type | Description |
|---|---|
| DocumentRange |
A DocumentRange value.
|
Set the CommentOptions.HighlightCommentedRange option to true to highlight the related range.
Use the CommentOptions.Color option to set the same color for all contents and related range highlights.
Tip
Use the Comment.BeginUpdate to obtain the SubDocument which is the content of the comment, edit it and subsequently finalize modification by calling the Comment.EndUpdate method.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Range 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-richedit-document-api/CS/RichEditAPISample/CodeExamples/Comments.cs#L22
if (document.Comments.Count > 0) {
DocumentRange[] resRanges = document.FindAll("trump", SearchOptions.None, document.Comments[1].Range);
if (resRanges.Length > 0) {
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/CommentsActions.cs#L30
if (document.Comments.Count > 0) {
DocumentRange[] resRanges = document.FindAll("trump", SearchOptions.None, document.Comments[1].Range);
if (resRanges.Length > 0) {
word-document-api-examples/CS/CodeExamples/CommentsActions.cs#L56
// to which the parent comment relates.
DocumentRange[] resRanges = document.FindAll("trump", SearchOptions.None, document.Comments[1].Range);
if (resRanges.Length > 0)
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Comments.vb#L21
If document.Comments.Count > 0 Then
Dim resRanges As DevExpress.XtraRichEdit.API.Native.DocumentRange() = document.FindAll("trump", DevExpress.XtraRichEdit.API.Native.SearchOptions.None, document.Comments(CInt((1))).Range)
If resRanges.Length > 0 Then
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/CommentsActions.vb#L28
If document.Comments.Count > 0 Then
Dim resRanges() As DocumentRange = document.FindAll("trump", SearchOptions.None, document.Comments(1).Range)
If resRanges.Length > 0 Then
word-document-api-examples/VB/CodeExamples/CommentsActions.vb#L50
' to which the parent comment relates.
Dim resRanges As DevExpress.XtraRichEdit.API.Native.DocumentRange() = document.FindAll("trump", DevExpress.XtraRichEdit.API.Native.SearchOptions.None, document.Comments(CInt((1))).Range)
If resRanges.Length > 0 Then
See Also