This documentation is archived and is not being maintained.

LineLength Property (General Extensibility)

Visual Studio .NET 2003

Returns the number of characters in a line containing the object, excluding the new line character.

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


Character numbering begins at one.


Sub LineLengthExample()
   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
   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
End Sub

See Also

Applies To: EditPoint Object | TextPoint Object | VirtualPoint Object