Skip to main content

CommentCollection Interface

A collection of Comment objects.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

Declaration

[ComVisible(true)]
public interface CommentCollection :
    ReadOnlyCommentCollection,
    ISimpleCollection<Comment>,
    IEnumerable<Comment>,
    IEnumerable,
    ICollection

The following members return CommentCollection objects:

Remarks

Items in the CommentCollection are ordered and indexed in the same order as the ranges to which they belong. That is, a comment whose Comment.Range is closer to the beginning of the document has a lower index value.

When you add a new comment, the CommentOptions.Visibility property is set to Visible.

Example

Comment

View Example

using DevExpress.XtraRichEdit.API.Native;
using DevExpress.XtraRichEdit;

static void CreateComment(RichEditDocumentServer wordProcessor) {

    // Load a document from a file.
    wordProcessor.LoadDocument("Documents\\Grimm.docx");

    // Access a document.
    Document document = wordProcessor.Document;

    if (document.Paragraphs.Count > 2) {
        // Access the range of the third paragraph.
        DocumentRange docRange = document.Paragraphs[2].Range;

        // Specify the comment's author name.
        string commentAuthor = "Johnson Alphonso D";

        // Create a comment.
        document.Comments.Create(docRange, commentAuthor, DateTime.Now);
    }
}
See Also