Partager via


XMLNodes.Parent Property

Gets a Microsoft.Office.Interop.Word.Document that represents the document containing the XMLNodes collection.

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

Syntax

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

Property Value

Type: System.Object
A Microsoft.Office.Interop.Word.Document that represents the document containing the XMLNodes collection.

Examples

The following code example uses the Parent property to display the name of the parent document of an XMLNodes collection. This example assumes that the current document contains an XMLNodes control named SampleInsertNodes.

Private Sub DisplayParentName()
    Dim document1 As Word.Document = _
        CType(Me.SampleInsertNodes.Parent, Word.Document)

    MsgBox("The parent of SampleInsertNodes" & _
        " is named " & document1.Name)

End Sub
private void DisplayParentName()
{
    Word.Document document1 =
        (Word.Document)this.SampleInsertNodes.Parent;

    MessageBox.Show("The parent of SampleInsertNodes" +
        " is named " + document1.Name);
}

.NET Framework Security

See Also

Reference

XMLNodes Interface

Microsoft.Office.Tools.Word Namespace