TextSelection::Insert Method (String^, Int32)

 

Inserts the given string at the current insertion point.

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

void Insert(
	String^ Text,
	int vsInsertFlagsCollapseToEndValue = 1
)

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