XMLNode.LastChild Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public:
property Microsoft::Office::Interop::Word::XMLNode ^ LastChild { Microsoft::Office::Interop::Word::XMLNode ^ get(); };
public Microsoft.Office.Interop.Word.XMLNode LastChild { get; }
member this.LastChild : Microsoft.Office.Interop.Word.XMLNode
Public ReadOnly Property LastChild As XMLNode
Property Value
Examples
The following code example uses the LastChild property to display the name of the last child node of an XMLNode control. The example also uses the HasChildNodes property to determine whether the XMLNode control has any child nodes. This example assumes that the current document contains an XMLNode named CustomerNode
.
private void DisplayLastChildName()
{
if (this.CustomerNode.HasChildNodes)
{
MessageBox.Show("The last child of '" +
this.CustomerNode.BaseName + "' is '" +
this.CustomerNode.LastChild.BaseName + "'.");
}
else
{
MessageBox.Show("'" + this.CustomerNode.BaseName +
"' has no child nodes.");
}
}
Private Sub DisplayLastChildName()
If Me.CustomerNode.HasChildNodes Then
MsgBox("The last child of '" & Me.CustomerNode.BaseName & _
"' is '" & Me.CustomerNode.LastChild.BaseName & "'.")
Else
MsgBox("'" & Me.CustomerNode.BaseName & _
"' has no child nodes.")
End If
End Sub
Remarks
Use the FirstChild property to access the first child node.