CommentCollection.AddThreadedComment
Contents
[
Hide
]AddThreadedComment(int, int, string, ThreadedCommentAuthor)
Adds a threaded comment.
public int AddThreadedComment(int row, int column, string text, ThreadedCommentAuthor author)
| Parameter | Type | Description |
|---|---|---|
| row | Int32 | Cell row index. |
| column | Int32 | Cell column index. |
| text | String | The text of the comment |
| author | ThreadedCommentAuthor | The user of this threaded comment. |
Return Value
ThreadedComment object index.
Examples
using System;
using Aspose.Cells;
namespace AsposeCellsExamples
{
public class CommentCollectionMethodAddThreadedCommentWithInt32Int32StringThreadedCommenDemo
{
public static void Run()
{
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
CommentCollection comments = worksheet.Comments;
int authorIndex = workbook.Worksheets.ThreadedCommentAuthors.Add("Demo Author", "demoUser", "testProvider");
ThreadedCommentAuthor author = workbook.Worksheets.ThreadedCommentAuthors[authorIndex];
comments.AddThreadedComment(1, 1, "This is a threaded comment demo.", author);
var threadedComments = comments.GetThreadedComments(1, 1);
foreach (var comment in threadedComments)
{
Console.WriteLine(comment.Notes);
}
workbook.Save("ThreadedCommentDemo.xlsx");
}
}
}
See Also
- class ThreadedCommentAuthor
- class CommentCollection
- namespace Aspose.Cells
- assembly Aspose.Cells
AddThreadedComment(string, string, ThreadedCommentAuthor)
Adds a threaded comment.
public int AddThreadedComment(string cellName, string text, ThreadedCommentAuthor author)
| Parameter | Type | Description |
|---|---|---|
| cellName | String | The name of the cell. |
| text | String | The text of the comment |
| author | ThreadedCommentAuthor | The user of this threaded comment. |
Return Value
ThreadedComment object index.
Examples
using System;
using Aspose.Cells;
namespace AsposeCellsExamples
{
public class CommentCollectionMethodAddThreadedCommentWithStringStringThreadedCommentDemo
{
public static void Run()
{
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
int authorIndex = workbook.Worksheets.ThreadedCommentAuthors.Add("John Doe", "JD", "");
ThreadedCommentAuthor author = workbook.Worksheets.ThreadedCommentAuthors[authorIndex];
CommentCollection comments = worksheet.Comments;
comments.AddThreadedComment("B3", "Initial comment text", author);
comments.AddThreadedComment("C5", "Follow-up comment", author);
workbook.Save("ThreadedCommentsOutput.xlsx");
}
}
}
See Also
- class ThreadedCommentAuthor
- class CommentCollection
- namespace Aspose.Cells
- assembly Aspose.Cells