Partager via


Word.OperationUnit enum

Spécifie l’unité de mesure utilisée dans les opérations Word.

Remarques

[ Ensemble d’API : WordApiDesktop 1.4 ]

Exemples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/55-selection/get-previous-next-range.yaml

// Gets the range of the next word relative to the current selection.
await Word.run(async (context) => {
  const options: Word.SelectionNextOptions = {
    unit: Word.OperationUnit.word,
    count: 1,
  };
  const nextRange: Word.Range = context.document.selection.getNextRange(options);
  nextRange.load("text");
  await context.sync();

  console.log(`Next word: "${nextRange.text}"`);
});

Champs

cell = "Cell"

Spécifie une unité de cellule.

character = "Character"

Spécifie une unité de caractères.

characterFormat = "CharacterFormat"

Spécifie une unité de format de caractère.

column = "Column"

Spécifie une unité de colonne.

item = "Item"

Spécifie une unité d’élément.

line = "Line"

Spécifie une unité de ligne.

paragraph = "Paragraph"

Spécifie une unité de paragraphe.

paragraphFormat = "ParagraphFormat"

Spécifie une unité de format de paragraphe.

row = "Row"

Spécifie une unité de ligne.

screen = "Screen"

Spécifie une unité d’écran.

section = "Section"

Spécifie une unité de section.

sentence = "Sentence"

Spécifie une unité de phrase.

story = "Story"

Spécifie une unité d’histoire.

table = "Table"

Spécifie une unité de table.

window = "Window"

Spécifie une unité de fenêtre.

word = "Word"

Spécifie une unité de mot.