TextSelection.NewLine Method

Inserts a line break character at the active point.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Sub NewLine ( _
    Count As Integer _
)
void NewLine(
    int Count
)
void NewLine(
    [InAttribute] int Count
)
abstract NewLine : 
        Count:int -> unit
function NewLine(
    Count : int
)

Parameters

  • Count
    Type: System.Int32

    Optional. Represents the number of NewLine characters to insert.

Remarks

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

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

.NET Framework Security

See Also

Reference

TextSelection Interface

EnvDTE Namespace