Back to Devexpress

CommentCollection.Remove(Comment) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-commentcollection-dot-remove-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-comment-x29.md

latest3.8 KB
Original Source

CommentCollection.Remove(Comment) Method

Removes the specified comment from the collection.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
void Remove(
    Comment comment
)
vb
Sub Remove(
    comment As Comment
)

Parameters

NameTypeDescription
commentComment

A Comment object to remove from the collection.

|

Example

View Example

csharp
Document document = server.Document;
document.LoadDocument("Documents\\Grimm.docx", DocumentFormat.Docx);
if (document.Comments.Count > 0)
{
    document.Comments.Remove(document.Comments[0]);
}
vb
Dim document As Document = server.Document
document.LoadDocument("Documents\Grimm.docx", DocumentFormat.Docx)
If document.Comments.Count > 0 Then
    document.Comments.Remove(document.Comments(0))
End If

The following code snippets (auto-collected from DevExpress Examples) contain references to the Remove(Comment) method.

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#L37

csharp
{
    document.Comments.Remove(document.Comments[0]);
}

word-document-api-examples/CS/CodeExamples/CommentsActions.cs#L76

csharp
// Delete the first comment.
    document.Comments.Remove(document.Comments[0]);
}

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Comments.vb#L34

vb
If document.Comments.Count > 0 Then
    document.Comments.Remove(document.Comments(0))
End If

word-document-api-examples/VB/CodeExamples/CommentsActions.vb#L66

vb
' Delete the first comment.
    document.Comments.Remove(document.Comments(0))
End If

See Also

CommentCollection Interface

CommentCollection Members

DevExpress.XtraRichEdit.API.Native Namespace