Share via


DocumentBase.Parent 屬性

取得文件的父物件。

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

語法

'宣告
Public ReadOnly Property Parent As Object
public Object Parent { get; }

屬性值

型別:System.Object
文件的父物件。

範例

下列程式碼範例會顯示訊息,說明文件的父物件。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

Private Sub DocumentParent()
    MessageBox.Show("The parent of the document is: " & Me.Parent.ToString())
End Sub
private void DocumentParent()
{
    MessageBox.Show("The parent of the document is: " +
        this.Parent.ToString());
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間