Condividi tramite


TextSelection.MoveToAbsoluteOffset(Int32, Boolean) Method

Definition

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

void MoveToAbsoluteOffset(int Offset, bool Extend = false);
[System.Runtime.InteropServices.DispId(40)]
public void MoveToAbsoluteOffset (int Offset, bool Extend = false);
[<System.Runtime.InteropServices.DispId(40)>]
abstract member MoveToAbsoluteOffset : int * bool -> unit
Public Sub MoveToAbsoluteOffset (Offset As Integer, Optional Extend As Boolean = false)

Parameters

Offset
Int32

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

Extend
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.

Attributes

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  

Applies to