Share via


XMLNode.ParentNode Property (2007 System)

Gets a XMLNode object that represents the parent element of the specified Microsoft.Office.Tools.Word.XMLNode control.

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

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property ParentNode As XMLNode
'Usage
Dim instance As XMLNode 
Dim value As XMLNode 

value = instance.ParentNode
[BrowsableAttribute(false)]
public XMLNode ParentNode { get; }
[BrowsableAttribute(false)]
public:
property XMLNode^ ParentNode {
    XMLNode^ get ();
}
public function get ParentNode () : XMLNode

Property Value

Type: XMLNode
A XMLNode control that represents the parent element of the specified Microsoft.Office.Tools.Word.XMLNode object.

Remarks

For a root node, the ParentNode property returns nulla null reference (Nothing in Visual Basic).

Examples

The following code example uses the ParentNode property to display the name of the parent node of an XMLNode control. This example assumes that the current document contains an XMLNode named CustomerFirstNameNode.

Private Sub DisplayParentNode()
    MsgBox("The parent node of '" & Me.CustomerFirstNameNode.BaseName & _
        "' is '" & Me.CustomerFirstNameNode.ParentNode.BaseName & "'.")
End Sub
private void DisplayParentNode()
{
    MessageBox.Show("The parent node of '" +
        this.CustomerFirstNameNode.BaseName + "' is '" + 
        this.CustomerFirstNameNode.ParentNode.BaseName + "'.");
}

.NET Framework Security

See Also

Reference

XMLNode Class

XMLNode Members

Microsoft.Office.Tools.Word Namespace