Share via


EditPoint.WordLeft 方法

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

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

语法

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

参数

  • Count
    类型:Int32

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

备注

WordLeft 将编辑点向左移动指定的单词数。 如果在到达 Count 单词数之前就到达文档开头,则编辑点保持在文档开头。

如果参数为负,则 WordLeft 的执行方式类似于 WordRight

示例

Sub WordLeftExample()
   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")
   objEditPt.WordLeft(3)
End Sub

.NET Framework 安全性

请参阅

参考

EditPoint 接口

EnvDTE 命名空间