CommentCollection

CommentCollection class

Encapsulates a collection of Comment objects.

class CommentCollection;

Example

const { Workbook } = require("aspose.cells.node");

var workbook = new Workbook();
var comments = workbook.getWorksheets().get(0).getComments();

Methods

MethodDescription
get(number)Gets the Comment element at the specified index.
get(string)Gets the Comment element at the specified cell.
get(number, number)Gets the Comment element at the specified row index and column index.
addThreadedComment(number, number, string, ThreadedCommentAuthor)Adds a threaded comment.
addThreadedComment(string, string, ThreadedCommentAuthor)Adds a threaded comment.
getThreadedComments(number, number)Gets the threaded comments by row and column index.
getThreadedComments(string)Gets the threaded comments by cell name.
add(number, number)Adds a comment to the collection.
add(string)Adds a comment to the collection.
removeAt(string)Removes the comment of the specific cell.
removeAt(number, number)Removes the comment of the specific cell.
clear()Removes all comments;
getCount()Gets the number of elements contained in.
isNull()Checks whether the implementation object is null.

get(number)

Gets the Comment element at the specified index.

get(index: number) : Comment;

Parameters:

ParameterTypeDescription
indexnumberThe zero based index of the element.

Returns

The element at the specified index.

get(string)

Gets the Comment element at the specified cell.

get(cellName: string) : Comment;

Parameters:

ParameterTypeDescription
cellNamestringCell name.

Returns

The element at the specified cell.

get(number, number)

Gets the Comment element at the specified row index and column index.

get(row: number, column: number) : Comment;

Parameters:

ParameterTypeDescription
rownumberRow index.
columnnumberColumn index.

Returns

The element at the specified cell.

addThreadedComment(number, number, string, ThreadedCommentAuthor)

Adds a threaded comment.

addThreadedComment(row: number, column: number, text: string, author: ThreadedCommentAuthor) : number;

Parameters:

ParameterTypeDescription
rownumberCell row index.
columnnumberCell column index.
textstringThe text of the comment
authorThreadedCommentAuthorThe user of this threaded comment.

Returns

ThreadedComment object index.

addThreadedComment(string, string, ThreadedCommentAuthor)

Adds a threaded comment.

addThreadedComment(cellName: string, text: string, author: ThreadedCommentAuthor) : number;

Parameters:

ParameterTypeDescription
cellNamestringThe name of the cell.
textstringThe text of the comment
authorThreadedCommentAuthorThe user of this threaded comment.

Returns

ThreadedComment object index.

getThreadedComments(number, number)

Gets the threaded comments by row and column index.

getThreadedComments(row: number, column: number) : ThreadedCommentCollection;

Parameters:

ParameterTypeDescription
rownumberThe row index.
columnnumberThe column index.

Returns

ThreadedCommentCollection

getThreadedComments(string)

Gets the threaded comments by cell name.

getThreadedComments(cellName: string) : ThreadedCommentCollection;

Parameters:

ParameterTypeDescription
cellNamestringThe name of the cell.

Returns

ThreadedCommentCollection

add(number, number)

Adds a comment to the collection.

add(row: number, column: number) : number;

Parameters:

ParameterTypeDescription
rownumberCell row index.
columnnumberCell column index.

Returns

Comment object index.

add(string)

Adds a comment to the collection.

add(cellName: string) : number;

Parameters:

ParameterTypeDescription
cellNamestringCell name.

Returns

Comment object index.

removeAt(string)

Removes the comment of the specific cell.

removeAt(cellName: string) : void;

Parameters:

ParameterTypeDescription
cellNamestringThe name of cell which contains a comment.

removeAt(number, number)

Removes the comment of the specific cell.

removeAt(row: number, column: number) : void;

Parameters:

ParameterTypeDescription
rownumberThe row index.
columnnumberthe column index.

clear()

Removes all comments;

clear() : void;

getCount()

Gets the number of elements contained in.

getCount() : number;

isNull()

Checks whether the implementation object is null.

isNull() : boolean;