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)

Syntax

'Declaration
Function GoTo ( _
    ByRef What As Object, _
    ByRef Which As Object, _
    ByRef Count As Object, _
    ByRef Name As Object _
) As Range
'Usage
Dim instance As Range
Dim What As Object
Dim Which As Object
Dim Count As Object
Dim Name As Object
Dim returnValue As Range

returnValue = instance.GoTo(What, Which, _
    Count, Name)
Range GoTo(
    ref Object What,
    ref Object Which,
    ref Object Count,
    ref Object Name
)

Parameters

  • What
    Type: System.Object%
    Optional Object. The kind of item to which the range or selection is moved. Can be one of the WdGoToItem constants.
  • Which
    Type: System.Object%
    Optional Object. The item to which the range or selection is moved. Can be one of the WdGoToDirection constants.
  • Count
    Type: System.Object%
    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
    Type: System.Object%
    Optional Object. If the What argument is wdGoToBookmark, wdGoToComment, wdGoToField, or wdGoToObject, this argument specifies a name.

Return Value

Type: Microsoft.Office.Interop.Word.Range

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.

See Also

Reference

Range Interface

Range Members

Microsoft.Office.Interop.Word Namespace