次の方法で共有


TextSelection.Insert(String, Int32) Method

Definition

Inserts the given string at the current insertion point.

void Insert(std::wstring const & Text, int vsInsertFlagsCollapseToEndValue = 1);
[System.Runtime.InteropServices.DispId(35)]
public void Insert (string Text, int vsInsertFlagsCollapseToEndValue = 1);
[<System.Runtime.InteropServices.DispId(35)>]
abstract member Insert : string * int -> unit
Public Sub Insert (Text As String, Optional vsInsertFlagsCollapseToEndValue As Integer = 1)

Parameters

Text
String

The text to insert.

vsInsertFlagsCollapseToEndValue
Int32

One of the vsInsertFlags values indicating how to insert the text.

Attributes

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  

Applies to