Word.NumberType enum
指定列表中的数字类型。
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/20-lists/format-list-range.yaml
// Counts only the level-1 (top-level) numbered paragraphs in the body range.
await Word.run(async (context) => {
const bodyRange: Word.Range = context.document.body.getRange();
const listFormat: Word.ListFormat = bodyRange.listFormat;
const options: Word.ListFormatCountNumberedItemsOptions = {
level: 1,
numberType: Word.NumberType.paragraph,
};
const count: OfficeExtension.ClientResult<number> = listFormat.countNumberedItems(options);
await context.sync();
console.log(`Level-1 item count: ${count.value}`);
});
字段
| allNumbers = "AllNumbers" | 其他所有情况下的默认值。 |
| listNum = "ListNum" | ListNum 字段的默认值。 |
| paragraph = "Paragraph" | 可通过在 "项目符号和编号" 对话框中选择模板的方式添加到段落中的预设编号。 |