Word.Critique interface

Critique that will be rendered as underline for the specified part of paragraph in the document.

Remarks

[ API set: WordApi 1.7 ]

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-annotations.yaml

// Adds annotations to the selected paragraph.
await Word.run(async (context) => {
  const paragraph = context.document.getSelection().paragraphs.getFirst();
  const critique1 = {
    colorScheme: Word.CritiqueColorScheme.red,
    start: 1,
    length: 3
  };
  const critique2 = {
    colorScheme: Word.CritiqueColorScheme.green,
    start: 6,
    length: 1
  };
  const critique3 = {
    colorScheme: Word.CritiqueColorScheme.blue,
    start: 10,
    length: 3
  };
  const critique4 = {
    colorScheme: Word.CritiqueColorScheme.lavender,
    start: 14,
    length: 3
  };
  const critique5 = {
    colorScheme: Word.CritiqueColorScheme.berry,
    start: 18,
    length: 10
  };
  const annotationSet: Word.AnnotationSet = {
    critiques: [critique1, critique2, critique3, critique4, critique5]
  };

  const annotationIds = paragraph.insertAnnotations(annotationSet);

  await context.sync();

  console.log("Annotations inserted:", annotationIds.value);
});

Properties

colorScheme

Gets the color scheme of the critique.

length

Gets the length of the critique inside paragraph.

popupOptions

Specifies the behavior of the pop-up menu for the critique.

start

Gets the start index of the critique inside paragraph.

Property Details

colorScheme

Gets the color scheme of the critique.

colorScheme: Word.CritiqueColorScheme | "Red" | "Green" | "Blue" | "Lavender" | "Berry";

Property Value

Word.CritiqueColorScheme | "Red" | "Green" | "Blue" | "Lavender" | "Berry"

Remarks

[ API set: WordApi 1.7 ]

length

Gets the length of the critique inside paragraph.

length: number;

Property Value

number

Remarks

[ API set: WordApi 1.7 ]

popupOptions

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies the behavior of the pop-up menu for the critique.

popupOptions: Word.CritiquePopupOptions;

Property Value

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

start

Gets the start index of the critique inside paragraph.

start: number;

Property Value

number

Remarks

[ API set: WordApi 1.7 ]