TextSelection.NewLine(Int32) 方法

定义

在活动点位置插入换行符。

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 失败。

适用于