PowerPoint.SensitivityLabelUpdateResult interface

Примечание

Этот API предоставляется в качестве предварительной версии для разработчиков и может быть изменен на основе полученных нами отзывов. Не используйте этот API в рабочей среде.

Представляет результат попытки обновить метку конфиденциальности в презентации. Содержит состояние результата, а также диагностические сведения о том, почему обновление было выполнено успешно или неудачно.

Комментарии

Набор API: PowerPointApi BETA (ТОЛЬКО ПРЕДВАРИТЕЛЬНАЯ ВЕРСИЯ)

Используется

Примеры

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/preview-apis/manage-sensitivity-labels.yaml

await PowerPoint.run(async (context) => {
  // Apply the selected sensitivity label to the presentation.
  const labelId = (document.getElementById("label-id") as HTMLSelectElement).value;
  if (!labelId) {
    console.warn("Get the available labels, and then select a label to apply.");
    return;
  }

  const presentation: PowerPoint.Presentation = context.presentation;
  const presentationLabel: PowerPoint.SensitivityLabel = presentation.sensitivityLabel;

  const updateResult: OfficeExtension.ClientResult<PowerPoint.SensitivityLabelUpdateResult> =
    presentationLabel.tryToUpdate(labelId);
  await context.sync();

  if (updateResult.value.status === PowerPoint.SensitivityLabelUpdateStatus.success) {
    console.log("Applied the sensitivity label to the presentation.");
  } else {
    console.error(`The sensitivity label wasn't applied. Status: ${updateResult.value.status}`);
  }
});

Свойства

status

Получает состояние результата попытки обновления.

Сведения о свойстве

status

Примечание

Этот API предоставляется в качестве предварительной версии для разработчиков и может быть изменен на основе полученных нами отзывов. Не используйте этот API в рабочей среде.

Получает состояние результата попытки обновления.

status: PowerPoint.SensitivityLabelUpdateStatus | "Success" | "UnspecifiedFailure" | "LabelNotFound" | "DocumentReadOnly" | "InsufficientPermission" | "UnsupportedDoubleKeyEncryption" | "LabelingDisabled" | "UserNotFound" | "UnsupportedUdp" | "ParentLabelNotSupported" | "CrossTenant" | "AbacAttributesNotAllowed" | "AbacAttributesRequired" | "UnsupportedAbac" | "LabelDisabled" | "RemovingLabelNotSupported";

Значение свойства

PowerPoint.SensitivityLabelUpdateStatus | "Success" | "UnspecifiedFailure" | "LabelNotFound" | "DocumentReadOnly" | "InsufficientPermission" | "UnsupportedDoubleKeyEncryption" | "LabelingDisabled" | "UserNotFound" | "UnsupportedUdp" | "ParentLabelNotSupported" | "CrossTenant" | "AbacAttributesNotAllowed" | "AbacAttributesRequired" | "UnsupportedAbac" | "LabelDisabled" | "RemovingLabelNotSupported"

Комментарии

Набор API: PowerPointApi BETA (ТОЛЬКО ПРЕДВАРИТЕЛЬНАЯ ВЕРСИЯ)