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
ID
Top
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
[C++]
HRESULT __stdcall get_LineCharOffset(
   /* [out, retval] */ long* retVal
);
[C#]
int LineCharOffset {get;}
[JScript .NET]
public function get LineCharOffset() : int

Remarks

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

Example

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
   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 | TextPoint Object | VirtualPoint Object

Show:
© 2015 Microsoft