Range.SetRange Method

Sets the starting and ending character positions for the range.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Sub SetRange ( _
    Start As Integer, _
    End As Integer _
)
'Usage
Dim instance As Range
Dim Start As Integer
Dim End As Integer

instance.SetRange(Start, End)
void SetRange(
    int Start,
    int End
)

Parameters

  • Start
    Type: System.Int32
    Required Integer. The starting character position of the range or selection.
  • End
    Type: System.Int32
    Required Integer. The ending character position of the range or selection.

Remarks

Character position values start at the beginning of the story, with the first value being 0 (zero). All characters are counted, including nonprinting characters. Hidden characters are counted even if they're not displayed.

The SetRange method redefines the starting and ending positions of an existing Range object. This method differs from the Range method, which is used to create a range, given a starting and ending position.

See Also

Reference

Range Interface

Range Members

Microsoft.Office.Interop.Word Namespace