共用方式為


DocumentBase.Parent Property

Gets the parent object of the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntax

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

Property Value

Type: System.Object
The parent object of the document.

Examples

The following code example displays a message that shows the parent of the document. To use this example, run it from the ThisDocument class in a document-level project.

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 Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace