Export (0) Print
Expand All

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
)

Parameters

Offset

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

Extend

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

Community Additions

ADD
Show:
© 2014 Microsoft