XMLNode.Parent Property (2007 System)
Gets a Document that represents the document containing the specified 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 Parent As Object
'Usage
Dim instance As XMLNode
Dim value As Object
value = instance.Parent
[BrowsableAttribute(false)]
public Object Parent { get; }
[BrowsableAttribute(false)]
public:
property Object^ Parent {
Object^ get ();
}
public function get Parent () : Object
Property Value
Type: System.Object
A Document that represents the document containing the specified XMLNode control.
Examples
The following code example uses the Parent property to display the name of the parent document of an XMLNode control. This example assumes that the current document contains an XMLNode named CustomerNode.
Private Sub DisplayParentName()
Dim document1 As Word.Document = _
CType(Me.CustomerNode.Parent, Word.Document)
MsgBox("The parent of '" & Me.CustomerNode.BaseName & _
"' is named " & document1.Name)
End Sub
private void DisplayParentName()
{
Word.Document document1 =
(Word.Document)this.CustomerNode.Parent;
MessageBox.Show("The parent of '" + this.CustomerNode.BaseName +
"' is named " + document1.Name);
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.