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.
RowNumberGets the row index of the comment.
ColumnNumberGets 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.
TextOrientationTypeNumberGets and sets the text orientation type of the comment. The value of the property is TextOrientationType integer constan
TextHorizontalAlignmentNumberGets and sets the text horizontal alignment type of the comment. The value of the property is TextAlignmentType integer
TextVerticalAlignmentNumberGets 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.
HeightCMNumberRepresents the height of the comment, in unit of centimeters.
WidthCMNumberRepresents the width of the comment, in unit of centimeters.
WidthNumberRepresents the width of the comment, in unit of pixels.
HeightNumberRepresents the Height of the comment, in unit of pixels.
WidthInchNumberRepresents the width of the comment, in unit of inches.
HeightInchNumberRepresents 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: Number

Comment.Column property

Gets the column index of the comment.

Type: Number

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: Number

Comment.TextHorizontalAlignment property

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

Type: Number

Comment.TextVerticalAlignment property

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

Type: Number

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: Number

Comment.WidthCM property

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

Type: Number

Comment.Width property

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

Type: Number

Comment.Height property

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

Type: Number

Comment.WidthInch property

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

Type: Number

Comment.HeightInch property

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

Type: Number

formatCharacters(startIndex, length, font, flag)

Format some characters with the font setting.

ParameterTypeDescription
startIndexNumberThe start index.
lengthNumberThe 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
startIndexNumberThe index of the start of the character.
lengthNumberThe 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