TextSelection.NewLine(Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在活动点位置插入换行符。
void NewLine(int Count = 1);
[System.Runtime.InteropServices.DispId(41)]
public void NewLine (int Count = 1);
[<System.Runtime.InteropServices.DispId(41)>]
abstract member NewLine : int -> unit
Public Sub NewLine (Optional Count As Integer = 1)
参数
- Count
- Int32
可选。 表示要插入的新建行字符数。
- 属性
示例
Sub NewLineExample()
' Before running this example, open a text document.
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
' Go to first line in document and select it.
objSel.GotoLine(1, True)
' Insert some new lines and some text.
objSel.NewLine(3)
objSel.Insert("A new line", vsInsertFlags.vsInsertFlagsInsertAtStart)
End Sub
注解
如果的值 Count 为负数或大于或等于10000,则将 NewLine 失败。