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)

Usage

Dim Start As Integer
Dim End As Integer
Dim range1 As Range
range1.SetRange(Start, End)

Syntax

Sub SetRange( _
    <InAttribute()> ByVal Start As Integer, _
    <InAttribute()> ByVal End As Integer _
)
void SetRange(
    [In] int Start, 
    [In] int End
);
public: Void SetRange(
    Int32 Start, 
    Int32 End
);
public void SetRange(
    /*in*/int Start, 
    /*in*/int End
);
function SetRange(
     Start : int, 
     End : int
);

Parameters

  • Start
    Required Integer. The starting character position of the range or selection.
  • End
    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.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

Range Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

Range Members