This example returns the starting position of the second paragraph and the ending position of the fourth paragraph in the active document. The character positions are used to create the range myRange
.
pos = ActiveDocument.Paragraphs(2).Range.Start
pos2 = ActiveDocument.Paragraphs(4).Range.End
Set myRange = ActiveDocument.Range(Start:=pos, End:=pos2)
This example determines the length of the selection by comparing the starting and ending character positions.
SelLength = Selection.End - Selection.Start
This example moves the starting position of myRange
one character to the right (this reduces the size of the range by one character).
Set myRange = Selection.Range
myRange.SetRange Start:=myRange.Start + 1, End:=myRange.End