Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Word.ListFormatCountNumberedItemsOptions interface
- Package:
- word
Represents options for counting numbered items in a range.
Remarks
Used by
Examples
// 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-2 (sub-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: 2,
numberType: Word.NumberType.paragraph,
};
const count: OfficeExtension.ClientResult<number> = listFormat.countNumberedItems(options);
await context.sync();
console.log(`Level-2 item count: ${count.value}`);
});
Properties
| level | If provided, specifies the level to count. The default value is 1. |
| numberType | If provided, specifies the type of number to count. The default value is |
Property Details
level
If provided, specifies the level to count. The default value is 1.
level?: number;
Property Value
number
Remarks
numberType
If provided, specifies the type of number to count. The default value is paragraph.
numberType?: Word.NumberType | "Paragraph" | "ListNum" | "AllNumbers";
Property Value
Word.NumberType | "Paragraph" | "ListNum" | "AllNumbers"
Remarks
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
