Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

VirtualPoint Interface

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

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

<GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8")> _
Public Interface VirtualPoint
	Inherits TextPoint
Dim instance As VirtualPoint

/** @attribute GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8") */ 
public interface VirtualPoint extends TextPoint
public interface VirtualPoint extends TextPoint

VirtualPoint objects are similar to the TextPoint object except that they can query virtual space in a document. VirtualPoint objects 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.

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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.