Comment Class

Encapsulates the object that represents a cell comment.
Inheritance Hierarchy
SystemObject
  Aspose.CellsComment

Namespace:  Aspose.Cells
Assembly:  Aspose.Cells (in Aspose.Cells.dll) Version: 20.1.0.0 (20.1)
Syntax
public class Comment

The Comment type exposes the following members.

Properties
  NameDescription
Public propertyAuthor
Gets and sets Name of the original comment author
Public propertyAutoSize
Indicates if size of comment is adjusted automatically according to its content.
Public propertyColumn
Gets the column index of the comment.
Public propertyCommentShape
Get a Shape object that represents the shape attached to the specified comment.
Public propertyFont
Gets the font of comment.
Public propertyHeight
Represents the Height of the comment, in unit of pixels.
Public propertyHeightCM
Represents the height of the comment, in unit of centimeters.
Public propertyHeightInch
Represents the height of the comment, in unit of inches.
Public propertyHtmlNote
Gets and sets the html string which contains data and some formats in this comment.
Public propertyIsVisible
Represents if the comment is visible or not.
Public propertyNote
Represents the content of comment.
Public propertyRow
Gets the row index of the comment.
Public propertyTextHorizontalAlignment
Gets and sets the text horizontal alignment type of the comment.
Public propertyTextOrientationType
Gets and sets the text orientation type of the comment.
Public propertyTextVerticalAlignment
Gets and sets the text vertical alignment type of the comment.
Public propertyThreadedComments
Gets the list of threaded comments;
Public propertyWidth
Represents the width of the comment, in unit of pixels.
Public propertyWidthCM
Represents the width of the comment, in unit of centimeters.
Public propertyWidthInch
Represents the width of the comment, in unit of inches.
Methods
  NameDescription
Public methodCharacters
Returns a Characters object that represents a range of characters within the comment text.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFormatCharacters
Format some chararcters with the font setting.
Public methodGetCharacters
Returns all Characters objects that represents a range of characters within the comment text.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
[C#]

Workbook workbook = new Workbook();
CommentCollection comments = workbook.Worksheets[0].Comments;

//Add comment to cell A1
int commentIndex = comments.Add(0, 0);
Comment comment = comments[commentIndex];
comment.Note = "First note.";
comment.Font.Name = "Times New Roman";

//Add comment to cell B2
comments.Add("B2");
comment = comments["B2"];
comment.Note = "Second note.";

[Visual Basic]

Dim workbook as Workbook = new Workbook()
Dim comments as CommentCollection = workbook.Worksheets(0).Comments

'Add comment to cell A1
Dim commentIndex as Integer = comments.Add(0, 0)
Dim comment as Comment = comments(commentIndex)
comment.Note = "First note."
comment.Font.Name = "Times New Roman"

'Add comment to cell B2
comments.Add("B2")
comment = comments("B2")
comment.Note = "Second note."
See Also