I do not know how to add a row to a particular table with "OneNote Add-in". RRS feed

  • Question

  • If there is more than one table on OneNote's page, you can not add a row to a particular table using the script below.

        Office.initialize = function(reason){}
                    var app = context.application;
                    var outline = app.getActiveOutline();
                    context.load(outline, "paragraphs, paragraphs/type");
                    return context.sync().then(function () {
                        var paragraphs = outline.paragraphs;
                        for (var i = 0; i < paragraphs.items.length; i++) {
                            var paragraph = paragraphs.items[i];
                            if (paragraph.type == "Table") {
                                var table = paragraph.table;
                                var row = table.appendRow(["Hello World!"]);
                        return context.sync();

    Looking at the official document, there seems to be a table ID, but I do not know how to use it.

    I want to know how to add a row to a specified table when OneNote's page has more than one table.

    Tuesday, October 30, 2018 7:18 AM

All replies