Word.BodyType enum

表示正文对象的类型。

注解

[ API 集:WordApi 1.3 ]

示例

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

// Gets the referenced note's item type and body type, which are both "Footnote".
await Word.run(async (context) => {
  const footnotes: Word.NoteItemCollection = context.document.body.footnotes;
  footnotes.load("items");
  await context.sync();

  const referenceNumber = $("#input-reference").val();
  const mark = (referenceNumber as number) - 1;
  const item: Word.NoteItem = footnotes.items[mark];
  console.log(`Note type of footnote ${referenceNumber}: ${item.type}`);

  item.body.load("type");
  await context.sync();

  console.log(`Body type of note: ${item.body.type}`);
});

字段

endnote = "Endnote"

尾注正文。

footer = "Footer"

页脚正文。

footnote = "Footnote"

脚注正文。

header = "Header"

标头正文。

mainDoc = "MainDoc"

主文档正文。

noteItem = "NoteItem"

注释正文,例如尾注、脚注。

section = "Section"

节正文。

shape = "Shape"

形状主体。

tableCell = "TableCell"

表单元格正文。

unknown = "Unknown"

未知的正文类型。