EditPoint2.WordRight(Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将对象向右移动指定的字数。
void WordRight(int Count = 1);
[System.Runtime.InteropServices.DispId(108)]
public void WordRight (int Count = 1);
[<System.Runtime.InteropServices.DispId(108)>]
abstract member WordRight : int -> unit
Public Sub WordRight (Optional Count As Integer = 1)
参数
- Count
- Int32
可选。 将缓冲区中的编辑点从当前位置向右移动的字数。
实现
- 属性
示例
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
注解
如果在单词前到达文档的末尾 Count ,则点将保留在文档末尾。
如果参数为负,则的 WordRight 执行方式类似于 WordLeft 。