Skip to content

Latest commit

 

History

History
50 lines (29 loc) · 1.48 KB

Word.Selection.End.md

File metadata and controls

50 lines (29 loc) · 1.48 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Selection.End property (Word)
vbawd10.chm158662660
vbawd10.chm158662660
Word.Selection.End
99e3bd79-a8f1-8057-1ac2-b9e76eab99ff
06/08/2017
medium

Selection.End property (Word)

Returns or sets the ending character position of a selection. Read/write Long.

Syntax

expression.End

expression A variable that represents a Selection object.

Remarks

If this property is set to a value smaller than the Start property, the Start property is set to the same value (that is, the Start and End property are equal).

The Selection object has a starting position and an ending position. The ending position is the point farthest away from the beginning of the story. This property returns the ending character position relative to the beginning of the story. The main document story (wdMainTextStory) begins with character position 0 (zero). You can change the size of a selection by setting this property.

Example

This example retrieves the ending position of the selection. This value is used to create a range so that a field can be inserted after the selection.

pos = Selection.End 
Set myRange = ActiveDocument.Range(Start:=pos, End:=pos) 
ActiveDocument.Fields.Add Range:=myRange, Type:=wdFieldAuthor

See also

Selection Object

[!includeSupport and feedback]