TextSelection.MoveToAbsoluteOffset Method

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

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

Syntax

'Declaration
Sub MoveToAbsoluteOffset ( _
    Offset As Integer, _
    Extend As Boolean _
)
void MoveToAbsoluteOffset(
    int Offset,
    bool Extend
)
void MoveToAbsoluteOffset(
    [InAttribute] int Offset, 
    [InAttribute] bool Extend
)
abstract MoveToAbsoluteOffset : 
        Offset:int * 
        Extend:bool -> unit
function MoveToAbsoluteOffset(
    Offset : int, 
    Extend : boolean
)

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.

Examples

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

.NET Framework Security

See Also

Reference

TextSelection Interface

EnvDTE Namespace