Document.Object 方法

返回在运行时可由名称访问的接口或对象。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
Function Object ( _
    ModelKind As String _
) As Object
Object Object(
    string ModelKind
)
Object^ Object(
    [InAttribute] String^ ModelKind
)
abstract Object : 
        ModelKind:string -> Object
function Object(
    ModelKind : String
) : Object

参数

  • ModelKind
    类型:String

    可选。 数据模型的类型。 使用的唯一值为“TextDocument” 和“文档”。

返回值

类型:Object
一个对象。

示例

Public Sub AddText()
    Dim doc As Document = ActiveDocument
    If Not doc Is Nothing Then
        Dim textDoc As TextDocument = doc.Object("TextDocument")
        If Not textDoc Is Nothing Then
            textDoc.CreateEditPoint().Insert("MyText")
        End If
    End If
End Sub

.NET Framework 安全性

请参阅

参考

Document 接口

EnvDTE 命名空间