共用方式為


DocumentBase.Parent Property

Definition

Gets the parent object of the document.

public:
 property System::Object ^ Parent { System::Object ^ get(); };
public object Parent { get; }
member this.Parent : obj
Public ReadOnly Property Parent As Object

Property Value

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 void DocumentParent()
{
    MessageBox.Show("The parent of the document is: " +
        this.Parent.ToString());
}
Private Sub DocumentParent()
    MessageBox.Show("The parent of the document is: " & Me.Parent.ToString())
End Sub

Applies to