I want to make a InsertTableRow Request via Docs API and it requires a TableStartLocation. I used
var tableName = table[0];
foreach (var element in document.Body.Content)
if (element.Table != null)
{
var checkTable = element.Table.TableRows[0].TableCells[0].Content[0].Paragraph.Elements[0]
.TextRun.Content.TrimEnd('\n'); //Get Text Value in first cell of the table
if (tableName.Equals(checkTable)) // Check if the table is the table that I want to add rows
{
Console.WriteLine("Add Table Row");
TableUpdateRequest(ref requests, table, element.StartIndex); // Using element(StructuralElement) to get StartIndex
break;
}
}
To find all table in a document and tried to use the element.StartIndex as Table Start Location but i got: Google.GoogleApiException : Google.Apis.Requests.RequestError Invalid requests[5].insertTableRow: Invalid table start location. Must specify the start index of the table. [400]
What is a suitable index for Table Start Location?