This documentation is archived and is not being maintained.

Selection.GoTo Method

Moves the insertion point to the character position immediately preceding the specified item.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

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 selection is moved. Can be one of the WdGoToItem constants.
Which
Type: System.Object%
Optional Object. The item to which the 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.

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.

Show: