EndOf Method Example

This example extends the selection to the end of the paragraph.

charmoved = Selection.EndOf(Unit:=wdParagraph, Extend:=wdExtend)
If charmoved = 0 Then MsgBox "Selection unchanged"

This example moves myRange to the end of the first word in the selection (after the trailing space).

Set myRange = Selection.Characters(1)
myRange.EndOf Unit:=wdWord, Extend:=wdMove

This example adds a table, selects the first cell in row two, and then extends the selection to the end of the column.

Set myRange = ActiveDocument.Range(0, 0)
Set myTable = ActiveDocument.Tables.Add(Range:=myRange, _
    NumRows:=5, NumColumns:=3)
myTable.Cell(2, 1).Select
Selection.EndOf Unit:=wdColumn, Extend:=wdExtend