RemoveChild Method

Microsoft Word Visual Basic

RemoveChild Method

Removes the specified child element from the specified element.

expression.RemoveChild(ChildElement)

expression    Required. An expression that returns an XMLNode object.

ChildElement    Required XMLNode. The child element to be removed.

Example

The following example removes the first child from the first element in the active document.

    ActiveDocument.XMLNodes(1).RemoveChild _
    ActiveDocument.XMLNodes(1).ChildNodes(1)