# GC.Spread.Sheets.Comments.CommentManager

## Content

# Class: CommentManager

[Sheets](../modules/GC.Spread.Sheets).[Comments](../modules/GC.Spread.Sheets.Comments).CommentManager

## Table of contents

### Constructors

- [constructor](GC.Spread.Sheets.Comments.CommentManager#constructor)

### Methods

- [add](GC.Spread.Sheets.Comments.CommentManager#add)
- [all](GC.Spread.Sheets.Comments.CommentManager#all)
- [clear](GC.Spread.Sheets.Comments.CommentManager#clear)
- [get](GC.Spread.Sheets.Comments.CommentManager#get)
- [remove](GC.Spread.Sheets.Comments.CommentManager#remove)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new CommentManager**(`sheet`)

Represents a comment manager that can manage all comments in a sheet.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `sheet` | [`Worksheet`](GC.Spread.Sheets.Worksheet) | The worksheet. |

## Methods

### <a id="add" name="add"></a> add

▸ **add**(`row`, `col`, `text`): [`Comment`](GC.Spread.Sheets.Comments.Comment)

Adds a comment to the cell for the indicated row and column.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `row` | `number` | The row index of the cell. |
| `col` | `number` | The column index of the cell. |
| `text` | `string` | The text of the comment. |

#### Returns

[`Comment`](GC.Spread.Sheets.Comments.Comment)

The comment that has been added to the cell.

___

### <a id="all" name="all"></a> all

▸ **all**(): [`Comment`](GC.Spread.Sheets.Comments.Comment)[]

Gets all comments in the sheet.

#### Returns

[`Comment`](GC.Spread.Sheets.Comments.Comment)[]

___

### <a id="clear" name="clear"></a> clear

▸ **clear**(`range`): `void`

Clears all of the comments in the indicated range on the sheet. When the range is not specified, it clears all the comments in the sheet.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `range` | [`Range`](GC.Spread.Sheets.Range) | The range that you want clear all comments from. |

#### Returns

`void`

___

### <a id="get" name="get"></a> get

▸ **get**(`row`, `col`): [`Comment`](GC.Spread.Sheets.Comments.Comment)

Gets the comment in the cell with the indicated row and column.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `row` | `number` | The row index of the cell. |
| `col` | `number` | The column index of the cell. |

#### Returns

[`Comment`](GC.Spread.Sheets.Comments.Comment)

The comment in the indicated cell.

___

### <a id="remove" name="remove"></a> remove

▸ **remove**(`row`, `col`): `void`

Removes the comment from the cell for the indicated row and column.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `row` | `number` | The row index of the cell. |
| `col` | `number` | The column index of the cell. |

#### Returns

`void`
