更新:2007 年 11 月
在当前插入点插入给定字符串。
命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)
语法
声明
Sub Insert ( _
    Text As String, _
    vsInsertFlagsCollapseToEndValue As Integer _
)
用法
Dim instance As TextSelection
Dim Text As String
Dim vsInsertFlagsCollapseToEndValue As Integer
instance.Insert(Text, vsInsertFlagsCollapseToEndValue)
void Insert(
    string Text,
    int vsInsertFlagsCollapseToEndValue
)
void Insert(
    [InAttribute] String^ Text, 
    [InAttribute] int vsInsertFlagsCollapseToEndValue
)
function Insert(
    Text : String, 
    vsInsertFlagsCollapseToEndValue : int
)
参数
- Text 
 类型:System.String- 要插入的文本。 
- vsInsertFlagsCollapseToEndValue 
 类型:System.Int32- vsInsertFlags 值之一,指示如何插入文本。 
示例
[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
权限
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。