Skip to main content
A newer version of this page is available. .

Comment.BeginUpdate() Method

Provides access to a comment’s content to start editing.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

SubDocument BeginUpdate()

Returns

Type Description
SubDocument

A SubDocument object which is the content of the comment.

Remarks

The BeginUpdate method allows you to change the content of a current comment. Use the Comment.EndUpdate method to finalize editing.

Example

document.LoadDocument("Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
Dim commentCount As Integer = document.Comments.Count
If commentCount > 0 Then
    Dim comment As DevExpress.XtraRichEdit.API.Native.Comment = document.Comments(document.Comments.Count - 1)
    If comment IsNot Nothing Then
        Dim commentDocument As SubDocument = comment.BeginUpdate()
        commentDocument.InsertText(commentDocument.CreatePosition(0), "some text")
        commentDocument.Tables.Create(commentDocument.CreatePosition(9), 5, 4)
        comment.EndUpdate(commentDocument)
    End If
End If

The following code snippets (auto-collected from DevExpress Examples) contain references to the BeginUpdate() 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.

See Also