Share via


EditPoint.WordRight 方法

将对象向右移动指定的单词数。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
Sub WordRight ( _
    Count As Integer _
)
void WordRight(
    int Count
)
void WordRight(
    [InAttribute] int Count
)
abstract WordRight : 
        Count:int -> unit
function WordRight(
    Count : int
)

参数

  • Count
    类型:Int32

    可选。 将缓冲区中的编辑点从当前位置向右移动的单词数。

备注

如果在到达 Count 单词数之前就到达文档结尾,则编辑点保持在文档结尾。

如果参数为负,则 WordRight 的执行方式类似于 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

.NET Framework 安全性

请参阅

参考

EditPoint 接口

EnvDTE 命名空间