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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。