Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

LineCharOffset Property (General Extensibility)

Visual Studio .NET 2003

Returns the character offset of the object.

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


Character numbering begins at one. LineCharOffset returns how many characters the object is from the left side of a line in the document.


Sub LineCharOffsetExample()
   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

© 2015 Microsoft