Share via


XMLNode.OwnerDocument Property

Gets a Microsoft.Office.Interop.Word.Document that represents the parent document of the specified XMLNode control.

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

Syntax

'Declaration
ReadOnly Property OwnerDocument As Document
Document OwnerDocument { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Document
A Microsoft.Office.Interop.Word.Document object that represents the parent document of the specified XMLNode control.

Remarks

The OwnerDocument property returns the same result as the Parent property.

Examples

The following code example uses the OwnerDocument property to display the name of the owner document of an XMLNode control. This example assumes that the current document contains an XMLNode named CustomerNode.

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 Security

See Also

Reference

XMLNode Interface

Microsoft.Office.Tools.Word Namespace