Condividi tramite


TextSelection.NewLine(Int32) Method

Definition

Inserts a line break character at the active point.

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)

Parameters

Count
Int32

Optional. Represents the number of NewLine characters to insert.

Attributes

Examples

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  

Remarks

If the value of Count is negative, or greater than or equal to 10,000, then NewLine fails.

Applies to