Comment

Comment class

Encapsulates the object that represents a cell comment.

Properties

NameTypeDescription
AuthorStringGets and sets Name of the original comment author
CommentShapeCommentShapeGet a Shape object that represents the shape attached to the specified comment.
RowintGets the row index of the comment.
ColumnintGets the column index of the comment.
IsThreadedCommentbooleanIndicates whether this comment is a threaded comment.
ThreadedCommentsThreadedCommentCollectionGets the list of threaded comments;
NoteStringRepresents the content of comment. If this is a threaded comment, the note could not be changed, otherwise MS Excel coul
HtmlNoteStringGets and sets the html string which contains data and some formats in this comment. If this is a threaded comment, the n
FontFontGets the font of comment.
IsVisiblebooleanRepresents if the comment is visible or not.
TextOrientationTypeintGets and sets the text orientation type of the comment. The value of the property is TextOrientationType integer constan
TextHorizontalAlignmentintGets and sets the text horizontal alignment type of the comment. The value of the property is TextAlignmentType integer
TextVerticalAlignmentintGets and sets the text vertical alignment type of the comment. The value of the property is TextAlignmentType integer co
AutoSizebooleanIndicates if size of comment is adjusted automatically according to its content.
HeightCMfloatRepresents the height of the comment, in unit of centimeters.
WidthCMfloatRepresents the width of the comment, in unit of centimeters.
WidthintRepresents the width of the comment, in unit of pixels.
HeightintRepresents the Height of the comment, in unit of pixels.
WidthInchfloatRepresents the width of the comment, in unit of inches.
HeightInchfloatRepresents the height of the comment, in unit of inches.

Methods

NameDescription
formatCharactersFormat some characters with the font setting.
charactersReturns a Characters object that represents a range of characters within the comment text.
getRichFormattingsReturns all Characters objects that represents a range of characters within the comment text.

Comment.Author property

Gets and sets Name of the original comment author

Type: String

Comment.CommentShape property

Get a Shape object that represents the shape attached to the specified comment.

Type: CommentShape

Comment.Row property

Gets the row index of the comment.

Type: int

Comment.Column property

Gets the column index of the comment.

Type: int

Comment.IsThreadedComment property

Indicates whether this comment is a threaded comment.

Type: boolean

Comment.ThreadedComments property

Gets the list of threaded comments;

Type: ThreadedCommentCollection

Comment.Note property

Represents the content of comment. If this is a threaded comment, the note could not be changed, otherwise MS Excel could not process it as a threaded comment.

Type: String

Comment.HtmlNote property

Gets and sets the html string which contains data and some formats in this comment. If this is a threaded comment, the note could not be changed, otherwise MS Excel could not process it as a threaded comment.

Type: String

Comment.Font property

Gets the font of comment.

Type: Font

Comment.IsVisible property

Represents if the comment is visible or not.

Type: boolean

Comment.TextOrientationType property

Gets and sets the text orientation type of the comment. The value of the property is TextOrientationType integer constant.

Type: int

Comment.TextHorizontalAlignment property

Gets and sets the text horizontal alignment type of the comment. The value of the property is TextAlignmentType integer constant.

Type: int

Comment.TextVerticalAlignment property

Gets and sets the text vertical alignment type of the comment. The value of the property is TextAlignmentType integer constant.

Type: int

Comment.AutoSize property

Indicates if size of comment is adjusted automatically according to its content.

Type: boolean

Comment.HeightCM property

Represents the height of the comment, in unit of centimeters.

Type: float

Comment.WidthCM property

Represents the width of the comment, in unit of centimeters.

Type: float

Comment.Width property

Represents the width of the comment, in unit of pixels.

Type: int

Comment.Height property

Represents the Height of the comment, in unit of pixels.

Type: int

Comment.WidthInch property

Represents the width of the comment, in unit of inches.

Type: float

Comment.HeightInch property

Represents the height of the comment, in unit of inches.

Type: float

formatCharacters(startIndex, length, font, flag)

Format some characters with the font setting.

ParameterTypeDescription
startIndexintThe start index.
lengthintThe length.
fontFontThe font setting.
flagStyleFlagThe flag of the font setting.

characters(startIndex, length)

Returns a Characters object that represents a range of characters within the comment text.

ParameterTypeDescription
startIndexintThe index of the start of the character.
lengthintThe number of characters.

Returns: Characters object.

getRichFormattings()

Returns all Characters objects that represents a range of characters within the comment text.

Returns: All Characters objects