XMLNode.OwnerDocument 屬性

取得 Microsoft.Office.Interop.Word.Document,這代表指定的 XMLNode 控制項的父文件。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word (在 Microsoft.Office.Tools.Word.dll 中)

語法

'宣告
ReadOnly Property OwnerDocument As Document
    Get
Document OwnerDocument { get; }

屬性值

型別:Microsoft.Office.Interop.Word.Document
Microsoft.Office.Interop.Word.Document 物件表示指定的 XMLNode 控制項的父文件。

備註

OwnerDocument 屬性傳回與 Parent 屬性相同的結果。

範例

下列程式碼範例使用 OwnerDocument 屬性顯示 XMLNode 控制項的擁有人文件名稱, 此範例假設目前的文件包含名為 CustomerNode 的 XMLNode

Private Sub DisplayDocumentName()
    Dim document1 As Word.Document = Me.CustomerNode.OwnerDocument
    MsgBox("The owner document of '" & Me.CustomerNode.BaseName & _
        "' is named " & document1.Name)
End Sub
private void DisplayDocumentName()
{
    Word.Document document1 =
        this.CustomerNode.OwnerDocument;

    MessageBox.Show("The owner document of '" + 
        this.CustomerNode.BaseName + "' is named " + 
        document1.Name);
}

.NET Framework 安全性

請參閱

參考

XMLNode 介面

Microsoft.Office.Tools.Word 命名空間