Word.SelectionNextOptions interface

Stellt die Optionen für die Selection.getNextRange-Methode dar.

Hinweise

API-Satz: WordApiDesktop 1.4

Verwendet von

Beispiele

// 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}"`);
});

Eigenschaften

count

Gibt (falls angegeben) die Anzahl der Einheiten an, um die Sie vorankommen möchten. Der Standardwert ist 1.

unit

Gibt (falls angegeben) den Einheitentyp an, um den die Auswahl verschoben werden soll. Der Standardwert ist character.

Details zur Eigenschaft

count

Gibt (falls angegeben) die Anzahl der Einheiten an, um die Sie vorankommen möchten. Der Standardwert ist 1.

count?: number;

Eigenschaftswert

number

Hinweise

API-Satz: WordApiDesktop 1.4

unit

Gibt (falls angegeben) den Einheitentyp an, um den die Auswahl verschoben werden soll. Der Standardwert ist character.

unit?: Word.OperationUnit | "Character" | "Word" | "Sentence" | "Paragraph" | "Line" | "Story" | "Screen" | "Section" | "Column" | "Row" | "Window" | "Cell" | "CharacterFormat" | "ParagraphFormat" | "Table" | "Item";

Eigenschaftswert

Word.OperationUnit | "Character" | "Word" | "Sentence" | "Paragraph" | "Line" | "Story" | "Screen" | "Section" | "Column" | "Row" | "Window" | "Cell" | "CharacterFormat" | "ParagraphFormat" | "Table" | "Item"

Hinweise

API-Satz: WordApiDesktop 1.4