Share via


Document.GoTo Method

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

Namespace:  Microsoft.Office.Tools.Word
Assemblies:   Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Syntax

'Declaration
Function GoTo ( _
    ByRef What As Object, _
    ByRef Which As Object, _
    ByRef Count As Object, _
    ByRef Name As Object _
) As Range
Range GoTo(
    ref Object What,
    ref Object Which,
    ref Object Count,
    ref Object Name
)

Parameters

  • What
    Type: System.Object%

    The kind of item to which the range or selection is moved. Can be one of the WdGoToItem values.

  • Count
    Type: System.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.

Return Value

Type: Range
A Range that represents the start position of the specified item, such as a page, bookmark, or field.

Remarks

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

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

.NET Framework Security

See Also

Reference

Document Interface

Microsoft.Office.Tools.Word Namespace