TextSelection::NewLine Method (Int32)
Visual Studio 2015
Inserts a line break character at the active point.
Assembly: EnvDTE (in EnvDTE.dll)
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
Show: