HasChildNodes Property

Microsoft Word Visual Basic

HasChildNodes Property

Returns True if the specified XML element has child elements.

expression.HasChildNodes

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

The following example validates the XML elements in the active document only if the element contains child nodes.

    Dim objElement As XMLNode

For Each objElement In ActiveDocument.XMLNodes
    If objElement.HasChildNodes = True Then
        objElement.Validate
    End If
Next