Compartilhar via


Document.Object(String) Method

Definition

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

winrt::Windows::Foundation::IInspectable Object(std::wstring const & ModelKind = "");
[System.Runtime.InteropServices.DispId(132)]
public object Object (string ModelKind = "");
[<System.Runtime.InteropServices.DispId(132)>]
abstract member Object : string -> obj
Public Function Object (Optional ModelKind As String = "") As Object

Parameters

ModelKind
String

Optional. The type of data model. The only values used are "TextDocument" and "Document".

Returns

An object.

Attributes

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  

Applies to