Shapes.Range Method 

Returns a ShapeRange object.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Usage

Dim Index As Object
Dim returnValue As ShapeRange
Dim shapes1 As Shapes
returnValue = shapes1.Range(Index)

Syntax

Function Range( _
    <InAttribute()> ByRef Index As Object _
) As ShapeRange
ShapeRange Range(
    [In] ref object Index
);
public: ShapeRange^ Range(
    &Object^ Index
);
public ShapeRange Range(
    /*in*/System.Object Index
);
function Range(
     Index : Object
) : ShapeRange;

Parameters

  • Index
    Required Object. Specifies which shapes are to be included in the specified range. Can be an integer that specifies the index number of a shape within the Shapes collection, a string that specifies the name of a shape, or an Object array that contains integers or strings.

Remarks

Character position values begin with 0 (zero) at the beginning of the document. All characters are counted, including nonprinting characters. Hidden characters are counted even if they're not displayed. If you don't specify starting and ending character positions for the Range method, the entire document is returned as a Range object.

ShapeRange objects don't include InlineShape objects. An InlineShape object is equivalent to a character and is positioned as a character within a range of text. Shape objects are anchored to a range of text (the selection, by default), but they can be positioned anywhere on the page. A Shape object will always appear on the same page as the range it's anchored to.

Most operations that you can do with a Shape object you can also do with a ShapeRange object that contains a single shape. Some operations, when performed on a ShapeRange object that contains multiple shapes, produce an error.

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

Shapes Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

Shapes Members