Managing Comments in a Worksheet
Adding Comments
To add a comment to a cell using Aspose.Cells.GridDesktop, please follow the steps below:
- Add Aspose.Cells.GridDesktop control to your Form
- Access any desired Worksheet
- Add Comment to the worksheet by specifying the cell (using its name or row & column number) in which the comment would be added.
The code below will add comments to the b2 and b4 cells of the worksheet.
Comments collection in the Worksheet object provides an overloaded Add method. Developers can use any overloaded version of Add method according to their specific needs.
Accessing Comments
To access and modify an existing comment in the worksheet, developers can access the comment from the Comments collection of the Worksheet by specifying the cell (using cell name or its location in terms of row and column number) in which the comment is inserted. Once the comment is accessed, developers can modify its Text at runtime.
Removing Comments
To remove an existing comment, developers can simply access a desired worksheet and then Remove comment from the Comments collection of the Worksheet by specifying the cell (using its name or row & column number) containing comment.