Range.GoTo Method 

Returns a Range object that represents the start position of the specified item, such as a page, bookmark, or field.

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

Usage

Dim What As Object
Dim Which As Object
Dim Count As Object
Dim Name As Object
Dim returnValue As Range
Dim range1 As Range
returnValue = range1.GoTo(What, Which, Count, Name)

Syntax

Function GoTo( _
    <InAttribute()> Optional ByRef What As Object, _
    <InAttribute()> Optional ByRef Which As Object, _
    <InAttribute()> Optional ByRef Count As Object, _
    <InAttribute()> Optional ByRef Name As Object _
) As Range
Range GoTo(
    [In, Optional] ref object What, 
    [In, Optional] ref object Which, 
    [In, Optional] ref object Count, 
    [In, Optional] ref object Name
);
public: Range^ GoTo(
    &Object^ What, 
    &Object^ Which, 
    &Object^ Count, 
    &Object^ Name
);
public Range GoTo(
    /*in*/System.Object What, 
    /*in*/System.Object Which, 
    /*in*/System.Object Count, 
    /*in*/System.Object Name
);
function GoTo(
     What : Object, 
     Which : Object, 
     Count : Object, 
     Name : Object
) : Range;

Parameters

  • What
    Optional Object. The kind of item to which the range or selection is moved. Can be one of the WdGoToItem constants.
  • Which
    Optional Object. The item to which the range or selection is moved. Can be one of the WdGoToDirection constants.
  • Count
    Optional Object. The number of the item in the document. The default value is 1.

    Only positive values are valid. To specify an item that precedes the range or selection, use wdGoToPrevious as the Which argument and specify a Count value.

  • Name
    Optional Object. If the What argument is wdGoToBookmark, wdGoToComment, wdGoToField, or wdGoToObject, this argument specifies a name.

Remarks

When you use the GoTo method with the wdGoToGrammaticalError, wdGoToProofreadingError, or wdGoToSpellingError constant, the Range that's returned includes any grammar error text or spelling error text.

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