Word.SelectionPreviousOptions interface
Представляет параметры для метода Selection.previous .
Комментарии
[ Набор API: WordApiDesktop 1.4 ]
Примеры
// 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}"`);
});
Свойства
| count | Если задано значение , указывает количество единиц, на которые требуется переместить. Значение по умолчанию равно 1. |
| unit | Если задано значение , указывает тип единицы, по которой будет перемещаться выделенный фрагмент. Значение по умолчанию — |
Сведения о свойстве
count
Если задано значение , указывает количество единиц, на которые требуется переместить. Значение по умолчанию равно 1.
count?: number;
Значение свойства
number
Комментарии
unit
Если задано значение , указывает тип единицы, по которой будет перемещаться выделенный фрагмент. Значение по умолчанию — character.
unit?: Word.OperationUnit | "Character" | "Word" | "Sentence" | "Paragraph" | "Line" | "Story" | "Screen" | "Section" | "Column" | "Row" | "Window" | "Cell" | "CharacterFormat" | "ParagraphFormat" | "Table" | "Item";
Значение свойства
Word.OperationUnit | "Character" | "Word" | "Sentence" | "Paragraph" | "Line" | "Story" | "Screen" | "Section" | "Column" | "Row" | "Window" | "Cell" | "CharacterFormat" | "ParagraphFormat" | "Table" | "Item"