Word.ContentControlState enum
Hinweis
Diese API wird als Vorschau für Entwickler bereitgestellt. Je nachdem, welches Feedback wir dazu erhalten, werden möglicherweise Änderungen vorgenommen. Verwenden Sie diese API nicht in einer Produktionsumgebung.
Stellt den Status des Inhaltssteuerelements dar.
Hinweise
API-Satz: WordApi BETA (NUR VORSCHAU)
Verwendet von
Beispiele
// 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}.`);
});
Felder
| error = "Error" | Fehlerstatus. |
| warning = "Warning" | Warnstatus. |