MoveToAbsoluteOffset Method
This documentation is archived and is not being maintained.

TextSelection.MoveToAbsoluteOffset Method

Moves the active point to the given 1-based absolute character offset.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

void MoveToAbsoluteOffset (
	[InAttribute] int Offset,
	[OptionalAttribute] [InAttribute] bool Extend
void MoveToAbsoluteOffset (
	/** @attribute InAttribute() */ int Offset, 
	/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ boolean Extend
function MoveToAbsoluteOffset (
	Offset : int, 
	Extend : boolean



Required. A character index from the start of the document, starting at one


Optional. Default = false. A Boolean value to extend the current selection. If Extend is true, then the active end of the selection moves to the location while the anchor end remains where it is. Otherwise, both ends are moved to the specified location. This argument applies only to the TextSelection object.

Sub MoveToAbsoluteOffsetExample()
   ' Before running this example, open a text document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   ' Go to first line in document and select it.
   objSel.GotoLine(1, True)
   ' Move to various lines and offsets (character columns).
   objSel.MoveToAbsoluteOffset(3, True)
   objSel.MoveToDisplayColumn(3, True)
End Sub
© 2016 Microsoft