AddComment
function AddComment(sText: string = null, sAuthor: string = null, sUserId: string = null): ApiComment
Description
Adds a comment to all contents of the current table. Please note that this table must be in the document.
Parameters
- sText
string
null The comment text (required).
- sAuthor
string
null The author's name (optional).
- sUserId
string
null The user ID of the comment author (optional).
Returns
ApiComment
Try It
var oDocument = Api.GetDocument();
var oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetBasedOn(oDocument.GetStyle("Bordered"));
var oTable = Api.CreateTable(3, 3);
oTable.SetWidth("percent", 100);
oTable.SetStyle(oTableStyle);
oDocument.Push(oTable);
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is just a sample text in the first cell.");
var oCell = oTable.GetCell(0,0);
oTable.AddElement(oCell, 0, oParagraph);
oTable.AddComment("comment", "John Smith");