Export (0) Print
Expand All
Expand Minimize

MoveToAbsoluteOffset Method (TextSelection Object)

Visual Studio .NET 2003

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

[Visual Basic .NET]
Public Sub MoveToAbsoluteOffset( _
   ByVal Offset As Integer, _
   Optional ByVal Extend As Boolean = False _
[Visual Basic 6]
Sub MoveToAbsoluteOffset( _
   ByVal Offset As Long, _
   Optional ByVal Extend As Boolean = False _
HRESULT __stdcall MoveToAbsoluteOffset(
   long Offset,
public void MoveToAbsoluteOffset(
   int Offset,
   bool Extend
[JScript .NET]
public 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

See Also

Applies To:TextSelection Object

© 2014 Microsoft