This documentation is archived and is not being maintained.

VirtualPoint Object

Visual Studio .NET 2003

Allows you to manipulate text beyond the right margin (left margin in bi-directional Windows) of the text document.






[Visual Basic .NET]
Public Interface VirtualPoint
    Inherits IDispatch
[Visual Basic 6]
Class VirtualPoint
interface VirtualPoint : IDispatch
public interface VirtualPoint : IDispatch
[JScript .NET]
public interface VirtualPoint extends IDispatch


VirtualPoint objects are similar to the TextPoint Object except that it has an added ability to query virtual space locations in a document. They are returned by TextSelection.StartPoint and TextSelection.EndPoint.

Virtual space is the empty space to the right of existing lines of text, and virtual points exist in this area.


Namespace: EnvDTE

File: dte.olb


Sub VirtualPointExample()
   ' Before running this example, open a text document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   Dim objActive As VirtualPoint = objSel.ActivePoint
   ' Collapse the selection to the beginning of the line.
   ' objActive is "live", tied to the position of the actual selection, 
   ' so it will reflect the new position.
   Dim iCol As Long = objActive.DisplayColumn
   ' Move the selection to the end of the line.

   MsgBox("The length of the insertion point line is " & (objActive.DisplayColumn - iCol) & " display characters.")
   MsgBox("VirtualCharOffset value: " & objActive.VirtualCharOffset & vbCr & "VirtualDisplayColumn value: " & objActive.VirtualDisplayColumn)
End Sub

See Also

Properties, Methods and Events | EditPoint Object | TextPoint Object | TextSelection Object