Range.GoTo(Object, Object, Object, Object) Range.GoTo(Object, Object, Object, Object) Method


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

public Microsoft.Office.Interop.Word.Range GoTo (ref object What, ref object Which, ref object Count, ref object Name);
Public Function GoTo (Optional ByRef What As Object, Optional ByRef Which As Object, Optional ByRef Count As Object, Optional ByRef Name As Object) As Range



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


Optional Object. The item to which the range or selection is moved. Can be one of the WdGoToDirection constants.


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.


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



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.

Applies to