EditPoint2::WordRight Method (Int32)
Visual Studio 2015
Moves the object the specified number of words to the right.
Assembly: EnvDTE80 (in EnvDTE80.dll)
Parameters
- Count
-
Type:
System::Int32
Optional. How many words to move the edit point to the right of its current position in the buffer.
Implements
EditPoint::WordRight(Int32)If the end of the document is reached before Count words, the point remains at the end of the document.
If the argument is negative, then WordRight performs similarly to WordLeft.
Sub WordRightExample() Dim objTextDoc As TextDocument Dim objEditPt As EditPoint, iCtr As Integer ' 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") objEditPt = objTextDoc.StartPoint.CreateEditPoint ' Insert ten lines of text. For iCtr = 1 To 10 objeditpt.Insert("This is a test." & Chr(13)) Next iCtr ' Replace the eighth word on the third line with a new word. objEditPt.StartOfDocument() objEditPt.LineDown(3) objEditPt.WordRight(3) objEditPt.Delete(4) objEditPt.Insert("raid") End Sub
Show: