Export (0) Print
Expand All
Cut
Run
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 _
) 
[C++]
HRESULT __stdcall MoveToAbsoluteOffset(
   long Offset,
   VARIANT_BOOL Extend
);
[C#]
public void MoveToAbsoluteOffset(
   int Offset,
   bool Extend
);
[JScript .NET]
public 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.

Example

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

Show:
© 2014 Microsoft