Word.TrailingCharacter enum
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Represents the character inserted after the list item mark.
Remarks
[ API set: WordApi BETA (PREVIEW ONLY) ]
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/manage-list-styles.yaml
// Gets the properties of the specified style.
await Word.run(async (context) => {
const styleName = $("#style-name-to-use").val() as string;
if (styleName == "") {
console.warn("Enter a style name to get properties.");
return;
}
const style: Word.Style = context.document.getStyles().getByNameOrNullObject(styleName);
style.load("type");
await context.sync();
if (style.isNullObject || style.type != Word.StyleType.list) {
console.warn(`There's no existing style with the name '${styleName}'. Or this isn't a list style.`);
} else {
// Load objects to log properties and their values in the console.
style.load();
style.listTemplate.load();
await context.sync();
console.log(`Properties of the '${styleName}' style:`, style);
const listLevels = style.listTemplate.listLevels;
listLevels.load("items");
await context.sync();
console.log(`List levels of the '${styleName}' style:`, listLevels);
}
});
Fields
trailingNone = "TrailingNone" | No character is inserted. |
trailingSpace = "TrailingSpace" | A space is inserted. Default. |
trailingTab = "TrailingTab" | A tab is inserted. |
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
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for