Word.SelectionMode enum
Represents where the cursor (insertion point) is set in the document after a selection.
Remarks
Used by
- Word.Body: select
- Word.ContentControl: select
- Word.Field: select
- Word.InlinePicture: select
- Word.Paragraph: select
- Word.Range: select
- Word.Table: select
- Word.TableRow: select
Examples
// 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();
});
Fields
| end = "End" | The cursor is at the end of the selection (just after the end of the selected range). |
| select = "Select" | The entire range is selected. |
| start = "Start" | The cursor is at the beginning of the selection (just before the start of the selected range). |