Export (0) Print
Expand All
ID
Top
Expand Minimize

Line Property (General Extensibility)

Visual Studio .NET 2003

Returns the line number of the object.

[Visual Basic .NET]
Public ReadOnly Property Line() As Long
[Visual Basic 6]
Property Get Line() As Long
[C++]
HRESULT __stdcall get_Line(
   /* [out, retval] */ long* retVal
);
[C#]
int Line {get;}
[JScript .NET]
public function get Line() : int

Remarks

Line numbers start at one.

Example

Sub LineExample()
   Dim objTextDoc As TextDocument
   Dim objTP As TextPoint, iCtr As Integer
   Dim msg As String

   ' 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")
   objTP = objTextDoc.StartPoint.CreateEditPoint

   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objTP.Insert("This is a test." & Chr(13))
   Next iCtr

   ' Capitalize the third word of the second line
   objTP.StartOfDocument()
   msg = "DisplayColumn value: " & objTP.DisplayColumn & vbCr
   msg = msg & "Line value: " & objTP.Line & vbCr
   msg = msg & "LineCharOffset value: " & objTP.LineCharOffset & vbCr
   msg = msg & "LineLength value: " & objTP.LineLength & vbCr
   MsgBox(msg)
End Sub

See Also

Applies To: EditPoint Object | TaskItem Object | TextPoint Object | VirtualPoint Object

Show:
© 2014 Microsoft