TextSelection.Insert Method
Inserts the given string at the current insertion point.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
Sub Insert ( _
Text As String, _
vsInsertFlagsCollapseToEndValue As Integer _
)
void Insert(
string Text,
int vsInsertFlagsCollapseToEndValue
)
void Insert(
[InAttribute] String^ Text,
[InAttribute] int vsInsertFlagsCollapseToEndValue
)
abstract Insert :
Text:string *
vsInsertFlagsCollapseToEndValue:int -> unit
function Insert(
Text : String,
vsInsertFlagsCollapseToEndValue : int
)
Parameters
Text
Type: System.StringThe text to insert.
vsInsertFlagsCollapseToEndValue
Type: System.Int32One of the vsInsertFlags values indicating how to insert the text.
Examples
[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
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.