Export (0) Print
Expand All
Cut
Run
Expand Minimize

MoveToAbsoluteOffset Method (EditPoint 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 _
) 
[Visual Basic 6]
Sub MoveToAbsoluteOffset( _
   ByVal Offset As Int _
) 
[C++]
HRESULT __stdcall MoveToAbsoluteOffset(
   int Offset
);
[C#]
public void MoveToAbsoluteOffset(
   int Offset
);
[JScript .NET]
public function MoveToAbsoluteOffset(
   Offset : int
)

Parameters

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

Example

Sub MoveToAbsoluteOffsetExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint, iCtr As Integer

   ' Create a new text file.
   DTE.ItemOperations.NewFile("General\Text File")

   ' Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objEditPt = objTextDoc.StartPoint.CreateEditPoint

   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objEditPt.Insert("This is a test." & Chr(13))
   Next iCtr
   objEditPt.MoveToAbsoluteOffset(10)
   objEditPt.Insert("HELLO")
   objEditPt.MoveToLineAndOffset(4, 5)
   objEditPt.Insert("WORLD")
End Sub

See Also

Applies To: EditPoint Object

Show:
© 2015 Microsoft