Word.SelectionNextOptions interface
Selection.next メソッドのオプションを表します。
注釈
[ API set: 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 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}"`);
});
プロパティの詳細
count
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"