This documentation is archived and is not being maintained.

EndPoint Property (General Extensibility)

Visual Studio .NET 2003

Returns the edit point that is the location of the end of the code item.

For the TextDocument and TextRange objects, returns a text point that is the location of the end of the document or range, respectively.

[Visual Basic .NET]
Public ReadOnly Property EndPoint() As TextPoint
[Visual Basic 6]
Property Get EndPoint() As TextPoint
HRESULT __stdcall get_EndPoint(
   /* [out, retval] */ TextPoint** retVal
TextPoint EndPoint {get;}
[JScript .NET]
public function get EndPoint() : TextPoint

Return Value

Returns a TextPoint object.


The edit point location is immediately after the last character of the code element (including any semicolon, or terminating or separating syntax). Fetching the property implicitly opens the source file if it can be opened. Some languages, however, cannot open arbitrary files on the disk and can only open files in currently open solution.


Sub EndPointExample()
   Dim objTextDoc As TextDocument
   Dim objMovePt As EditPoint
   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
   objMovePt = objTextDoc.EndPoint.CreateEditPoint
   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objEditPt.Insert("This is a test." & Chr(13))
   Next iCtr
   ' Move the active point to where the second edit point is
   ' and then insert some text.
End Sub

See Also

Applies To: CodeAttribute Object | CodeClass Object | CodeDelegate Object | CodeElement Object | CodeEnum Object | CodeFunction Object | CodeInterface Object | CodeNameSpace Object | CodeParameter Object | CodeProperty Object | CodeStruct Object | CodeType Object | CodeVariable Object | TextDocument Object | TextRange Object | VCCodeAttribute Object | VCCodeBase Object | VCCodeClass Object | VCCodeDelegate Object | VCCodeElement Object | VCCodeEnum Object | VCCodeEvent Object | VCCodeFunction Object | VCCodeIDLCoClass Object | VCCodeIDLImport Object | VCCodeIDLImportLib Object | VCCodeIDLLibrary Object | VCCodeImport Object | VCCodeInclude Object | VCCodeInterface Object | VCCodeMacro Object | VCCodeMap Object | VCCodeMapEntry Object | VCCodeNamespace Object | VCCodeParameter Object | VCCodeProperty Object | VCCodeStruct Object | VCCodeTypedef Object | VCCodeUnion Object | VCCodeUsing Object | VCCodeVariable Object | VCFileCodeModel Object