Udostępnij za pośrednictwem


Document.Object Method

Returns an interface or object that can be accessed at run time by name.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
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

Parameters

  • ModelKind
    Type: System.String
    Optional. The type of data model. The only values used are "TextDocument" and "Document".

Return Value

Type: System.Object
An object.

Examples

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 Security

See Also

Reference

Document Interface

EnvDTE Namespace