Word.InsertLocation enum

表示插入位置类型。

注解

API 集:WordApi 1.1

用于 API 调用,例如 obj.insertSomething(newStuff, location);. 如果位置为 beforeafter,则新内容将位于已修改对象之外。 如果位置为 startend,则新内容将作为已修改对象的一部分包括在内。

使用方

示例

// 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: Word.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"

在调用对象内容之前预置内容。