I'm having difficulties to update the values of a Word.TableRow using the Javascript API. I've look to Doc and I can't find any hints that will help me to accomplish my duty...
Here is my Question: What is the best way to set the values of a TableRow inside a Word Document using the Javascript API.
And Here is what I tried:
Word.run((context: Word.RequestContext) => {
var tables = context.document.body.tables;
tables.load("items");
return context.sync().then(() => {
var firstTableRows = tables.items[0].rows;
context.load(firstTableRows, "items");
context.sync().then(() => {
var header = firstTableRows.items[0];
header.load("values");
context.sync().then(() => {
header.values = ["MyValue"]
context.sync();
});
});
});
}).catch(errorHandler);
This is a 1x2 table
No errors are thrown and the table is not getting updated...
Am I missing something?
.catch(errorHandler);to see if you are generating an error.