Add Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Adds a new comment to the document.
Syntax
Add()
Opens a comment input control so that the end-user can type the comment's text. The new comment is inserted after the input control has been closed.
public CommentCollection.AddResult Add();Public Function Add() As CommentCollection.AddResultAdd(CommentedText)
Adds a new comment given through the specified CommentedText object.The commented text is defined through the CommentedText.Start and CommentedText.Length properties. If the length of the commented text is zero, the current text selection is used to define the text associated with the comment.
public CommentCollection.AddResult Add(CommentedText commentedText);Public Function Add(commentedText As CommentedText) As CommentCollection.AddResult| Parameter | Description |
|---|---|
| commentedText | Defines the commented text and its comment to add. |
Return Value
The return value specifies whether the comment input control could be opened or the new comment has successfully been inserted. It can be one of the CommentCollection.AddResult values.
Examples
The following example works with comments in the current document by using CommentCollection.Add.
CommentCollection commentCollection = textControl.Comments;
var result = commentCollection.Add(new CommentedText("Quarterly report"));
Console.WriteLine($"Add result: {result}");Dim commentCollection As CommentCollection = textControl.Comments
Dim result = commentCollection.Add(New CommentedText("Quarterly report"))
Console.WriteLine($"Add result: {result}")