Word.ContentControlState enum
Примечание
Этот API предоставляется в качестве предварительной версии для разработчиков и может быть изменен на основе полученных нами отзывов. Не используйте этот API в рабочей среде.
Представляет состояние элемента управления содержимым.
Комментарии
Набор API: WordApi BETA (ТОЛЬКО ПРЕДВАРИТЕЛЬНАЯ ВЕРСИЯ)
Используется
Примеры
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/insert-and-change-content-controls.yaml
// Marks the sample content control with a warning.
await Word.run(async (context) => {
const sampleControl: Word.ContentControl = context.document.contentControls
.getByTag("ContentControlStateSample").getFirstOrNullObject();
await context.sync();
if (sampleControl.isNullObject) {
console.warn("Run Set up to create the sample content control.");
return;
}
const state: Word.ContentControlState = Word.ContentControlState.warning;
sampleControl.setState(state);
await context.sync();
console.log(`Set sample content control state to ${state}.`);
});
Поля
| error = "Error" | Состояние ошибки. |
| warning = "Warning" | Состояние предупреждения. |