Word.SelectionPreviousOptions interface

Stellt die Optionen für die Selection.getPreviousRange-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 previous word relative to the current selection.
await Word.run(async (context) => {
  const options: Word.SelectionPreviousOptions = {
    unit: Word.OperationUnit.word,
    count: 1,
  };
  const previousRange: Word.Range = context.document.selection.getPreviousRange(options);
  previousRange.load("text");
  await context.sync();

  console.log(`Previous word: "${previousRange.text}"`);
});

Eigenschaften

count

Falls angegeben, gibt die Anzahl der Einheiten an, um die verschoben werden soll. 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

Falls angegeben, gibt die Anzahl der Einheiten an, um die verschoben werden soll. 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