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

Definition

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);
abstract member GoTo : obj * obj * obj * obj -> Microsoft.Office.Interop.Word.Range
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

Parameters

What
Object

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

Which
Object

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

Count
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
Object

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

Returns

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.

Applies to