Adds a comment to all contents of the current table.
Name | Type | Description |
sText | string | The comment text (required). |
sAuthor | string | The author's name (optional). |
builder.CreateFile("docx"); 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"); builder.SaveFile("docx", "AddComment.docx"); builder.CloseFile();