TextSelection::NewLine Method (Int32)

 

Inserts a line break character at the active point.

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

void NewLine(
	int Count = 1
)

Parameters

Count
Type: System::Int32

Optional. Represents the number of NewLine characters to insert.

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

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
Return to top
Show: