TextSelection::Insert Method (String^, Int32)
Visual Studio 2015
Inserts the given string at the current insertion point.
Assembly: EnvDTE (in EnvDTE.dll)
Parameters
- Text
-
Type:
System::String^
The text to insert.
- vsInsertFlagsCollapseToEndValue
-
Type:
System::Int32
One of the vsInsertFlags values indicating how to insert the text.
[Visual Basic]
Sub InsertExample()
' Before running this example, open a text document.
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
' Go to the 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: