Word.SelectionMode enum
表示在文档中选择后设置光标 (插入点) 的位置。
注解
使用方
- Word.正文: 选择
- Word.ContentControl: select
- Word.字段:选择
- Word.InlinePicture: 选择
- Word.段落:选择
- Word.范围:选择
- Word.表: 选择
- Word.TableRow: select
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/35-ranges/scroll-to-range.yaml
// Moves the insertion point to the end of the final paragraph.
await Word.run(async (context) => {
const lastRange: Word.Range = context.document.body.paragraphs.getLast().getRange();
const selectionMode: Word.SelectionMode = Word.SelectionMode.end;
lastRange.select(selectionMode);
await context.sync();
});
字段
| end = "End" | 光标位于所选内容的末尾 (就在所选区域) 的末尾之后。 |
| select = "Select" | 将选中整个范围。 |
| start = "Start" | 光标位于所选区域 (的开头,就在所选区域) 的开始之前。 |