EditPoint.GetLines Method
Visual Studio 2012
Gets a string representing the text between two given lines.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Parameters
- Start
- Type: System.Int32
Optional. The last line number to include the text.
- ExclusiveEnd
- Type: System.Int32
Required. The first line number to include the text.
Sub GetLinesExample() 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.StartOfDocument() msgbox("The results of GetLines: " & Chr(13) & objeditpt.GetLines(1, 6)) End Sub
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.