Comment.BeginUpdate() Method
Provides access to a comment’s content to start editing.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v20.2.Core.dll
NuGet Package: DevExpress.RichEdit.Core
NuGet Packages: DevExpress.RichEdit.Core, DevExpress.WindowsDesktop.RichEdit.Core
Declaration
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 document = server.Document;
document.LoadDocument("Documents\\Grimm.docx", DocumentFormat.OpenXml);
int commentCount = document.Comments.Count;
if (commentCount > 0)
{
Comment comment = document.Comments[document.Comments.Count - 1];
if (comment != null)
{
SubDocument commentDocument = comment.BeginUpdate();
commentDocument.InsertText(commentDocument.CreatePosition(0), "some text");
commentDocument.Tables.Create(commentDocument.CreatePosition(9), 5, 4);
comment.EndUpdate(commentDocument);
}
}
Related GitHub Examples
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.