Word.InsertLocation enum

挿入場所の種類。

注釈

[ API セット: WordApi 1.1 ]

などの obj.insertSomething(newStuff, location);API 呼び出しで使用する。 場所が "Before" または "After" の場合、新しいコンテンツは変更されたオブジェクトの外部に配置されます。 場所が "Start" または "End" の場合、変更されたオブジェクトの一部として新しいコンテンツが含まれます。

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/insert-section-breaks.yaml

// Inserts a section without an associated page break.
await Word.run(async (context) => {
  const body = context.document.body;
  body.insertBreak(Word.BreakType.sectionContinuous, Word.InsertLocation.end);

  await context.sync();

  console.log("Inserted section without an associated page break");
});

フィールド

after = "After"

呼び出し元オブジェクトの内容の後にコンテンツを追加します。

before = "Before"

呼び出し元オブジェクトの内容の前にコンテンツを追加します。

end = "End"

呼び出し元オブジェクトの内容にコンテンツを追加します。

replace = "Replace"

現在のオブジェクトの内容を置き換えます。

start = "Start"

呼び出し元オブジェクトのコンテンツの先頭にコンテンツを追加します。