Word.SelectionPreviousOptions interface
Stellt die Optionen für die Selection.previous-Methode dar.
Hinweise
[ API-Satz: WordApiDesktop 1.4 ]
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 | Wenn angegeben, gibt die Anzahl der Einheiten an, um die Sie verschieben möchten. Der Standardwert ist 1. |
| unit | Falls angegeben, gibt den Typ der Einheit an, um die Die Auswahl verschoben werden soll. Der Standardwert ist |
Details zur Eigenschaft
count
Wenn angegeben, gibt die Anzahl der Einheiten an, um die Sie verschieben möchten. Der Standardwert ist 1.
count?: number;
Eigenschaftswert
number
Hinweise
unit
Falls angegeben, gibt den Typ der Einheit an, um die 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"