Word.InsertLocation enum

插入位置类型。

注解

[ API 集:WordApi 1.1 ]

要与 API 调用一起使用,例如 obj.insertSomething(newStuff, location);。 如果位置为“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"

将内容附加到调用对象的内容。