次の方法で共有


Word.ErrorCodes enum

注釈

// 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"