TextSelection::MoveToAbsoluteOffset Method (Int32, Boolean)
Visual Studio 2015
Moves the active point to the given 1-based absolute character offset.
Assembly: EnvDTE (in EnvDTE.dll)
Parameters
- Offset
-
Type:
System::Int32
Required. A character index from the start of the document, starting at one
- Extend
-
Type:
System::Boolean
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
Show: