Export (0) Print
Expand All

EditPoint Interface

Allows you to manipulate text as data in text buffers.

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

[<GuidAttribute("C1FFE800-028B-4475-A907-14F51F19BB7D")>]
type EditPoint =  
    interface 
        interface TextPoint 
    end

The EditPoint type exposes the following members.

  NameDescription
Public propertyAbsoluteCharOffsetGets the one-based character offset of the EditPoint object.
Public propertyAtEndOfDocumentGets a value indicating whether or not the object is at the end of the document.
Public propertyAtEndOfLineGets a value indicating whether or not the object is at the end of a line.
Public propertyAtStartOfDocumentGets a value indicating whether or not the object is at the beginning of the document.
Public propertyAtStartOfLineGets a value indicating whether or not the EditPoint object is at the beginning of a line.
Public propertyCodeElementGets the code element at the EditPoint location.
Public propertyDisplayColumnGets the number of the column number of the EditPoint object.
Public propertyDTEGets the top-level extensibility object.
Public propertyLineGets the EditPoint object's line number.
Public propertyLineCharOffsetGets the character offset of the EditPoint object.
Public propertyLineLengthGets the number of characters in a line.
Public propertyParentGets the immediate parent object of the EditPoint object.
Top

  NameDescription
Public methodChangeCaseChanges the case of the selected text.
Public methodCharLeftMoves the edit point the specified number of characters to the left.
Public methodCharRightMoves the edit point the specified number of characters to the right.
Public methodClearBookmarkClears any unnamed bookmarks in the current text buffer line.
Public methodCopyCopies the specified range of text to the clipboard.
Public methodCreateEditPointCreates and returns an EditPoint object at the location of the calling object.
Public methodCutCopies the specified range of text to the clipboard and deletes it from the document.
Public methodDeleteDeletes the specified range of text.
Public methodDeleteWhitespaceDeletes the empty characters (white space) horizontally or vertically around the current location in the text buffer.
Public methodEndOfDocumentMoves the edit point to the end of the document.
Public methodEndOfLineMoves the edit point to the end of the current line in the buffer.
Public methodEqualToReturns a value indicating whether the value of the given point object's AbsoluteCharOffset is equal to that of the calling EditPoint object.
Public methodFindPatternFinds a given matching pattern in the selected text.
Public methodGetLinesGets a string representing the text between two given lines.
Public methodGetTextGets the text between the current location and the specified location in the buffer.
Public methodGreaterThanReturns whether the value of the EditPoint object's AbsoluteCharOffset property is greater than that of the given TextPoint object.
Public methodIndentIndents the selected lines by the given number of indentation levels.
Public methodInsertInserts the given string at the edit point's current position in the buffer.
Public methodInsertFromFileInserts the contents of the specified file at the current location in the buffer.
Public methodLessThanReturns whether the value of the called EditPoint object's AbsoluteCharOffset is less than that of the given TextPoint object.
Public methodLineDownMoves the edit point down the specified number of lines.
Public methodLineUpMoves the edit point up the specified number of lines.
Public methodMoveToAbsoluteOffsetMoves the active point to the given 1-based absolute character offset.
Public methodMoveToLineAndOffsetMoves the document to the specified line and character offset position in that line.
Public methodMoveToPointMoves the active point to the given position.
Public methodNextBookmarkMoves to the location of the next bookmark in the document.
Public methodOutlineSectionCreates an outlining section based on an edit point and the given text point or value.
Public methodPadToColumnFills the current line in the buffer with empty characters (white space) to the given column.
Public methodPasteInserts the clipboard contents at the current location.
Public methodPreviousBookmarkMoves the edit point to the location of the previous bookmark in the document.
Public methodReadOnlyReturns a value indicating whether any of the specified range contains read-only text.
Public methodReplacePatternFinds a pattern in the specified range of text and replaces it with the specified text.
Public methodReplaceTextReplaces the selected text with the given text.
Public methodSetBookmarkSets an unnamed bookmark on the current line in the buffer.
Public methodSmartFormatFormats the specified range of text based on the current language.
Public methodStartOfDocumentMoves the object to the beginning of the document.
Public methodStartOfLineMoves the edit point to the beginning of the current line in the buffer.
Public methodTryToShowAttempts to display the text point's location.
Public methodUnindentRemoves the indent characters from the selected lines by the given number of indentation levels.
Public methodWordLeftMoves the object the specified number of words to the left.
Public methodWordRightMoves the object the specified number of words to the right.
Top

EditPoint objects are similar to TextSelection objects, except that they operate on data in the text buffer rather than on text displayed in a code editor. The difference is that text in the buffer is not affected by global editor states, such as word wrapping and virtual spaces.

Any operation that attempts to modify a text document fails if it affects any characters that are contained in a read-only block, or if the document itself is read-only.

Sub EditPointExample()
  ' Before running this example, open a text document.
  Dim objTD As TextDocument
  Dim objEP As EditPoint

  objTD = DTE.ActiveDocument.Object("TextDocument")
  objEP = objTD.StartPoint.CreateEditPoint
  objEP.Insert "Hello"
End Sub
Show:
© 2014 Microsoft