Word.ErrorCodes enum
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/10-content-controls/insert-and-change-checkbox-content-control.yaml
async function tryCatch(callback) {
try {
await callback();
} catch (error) {
// Note: In a production add-in, you'd want to notify the user through your add-in's UI.
if (error.code === Word.ErrorCodes.itemNotFound) {
console.warn("No checkbox content control is currently selected.");
} else {
console.error(error);
}
}
}
accessDenied = "AccessDenied" | |
generalException = "GeneralException" | |
invalidArgument = "InvalidArgument" | |
itemNotFound = "ItemNotFound" | |
notAllowed = "NotAllowed" | |
notImplemented = "NotImplemented" | |
searchDialogIsOpen = "SearchDialogIsOpen" | |
searchStringInvalidOrTooLong = "SearchStringInvalidOrTooLong" |
Zusammenarbeit auf GitHub
Die Quelle für diesen Inhalt finden Sie auf GitHub, wo Sie auch Issues und Pull Requests erstellen und überprüfen können. Weitere Informationen finden Sie in unserem Leitfaden für Mitwirkende.
Feedback zu Office Add-ins
Office Add-ins ist ein Open Source-Projekt. Wählen Sie einen Link aus, um Feedback zu geben: