Office.jsを使用してドキュメントの本文内にテーブルを挿入しようとしましたが、役に立たないです。Officeアドインの開発:Wordでテーブルを挿入します。2016
私は、次のコードを使用しています
function insertSampleTable() {
showNotification("Insert Table", "Inserting table...")
Word.run(function (context) {
// Create a proxy object for the document body.
var body = context.document.body;
body.insertTable(2, 2, Word.InsertLocation.end, ["a"]);
// Synchronize the document state by executing the queued commands, and return a promise to indicate task completion.
return context.sync();
})
.catch(errorHandler);
}
をしかし、ボタンをクリックすると、それは私に、以下のエラー与える:
Error: TypeError: Object doesn't support property or method 'insertTable'
任意の助けが理解されるであろうが。私はMicrosoft Office Devサイトをチェックしようとしましたが、このようなサンプルはありません。
ありがとうございます!
Michael 1.3 APIの一部としてテーブルオブジェクトを追加しました。オープン仕様を確認してください:https://github.com/OfficeDev/office-js-docs/tree/WordJs_1.3_Openspec –