Freigeben über


CustomXMLNode.ReplaceChildNode Method

Removes the specified child node (and its subtree) from the main tree, and replaces it with a different node in the same location.

Namespace:  Microsoft.Office.Core
Assembly:  office (in office.dll)

Syntax

'Declaration
Sub ReplaceChildNode ( _
    OldNode As CustomXMLNode, _
    Name As String, _
    NamespaceURI As String, _
    NodeType As MsoCustomXMLNodeType, _
    NodeValue As String _
)
'Usage
Dim instance As CustomXMLNode
Dim OldNode As CustomXMLNode
Dim Name As String
Dim NamespaceURI As String
Dim NodeType As MsoCustomXMLNodeType
Dim NodeValue As String

instance.ReplaceChildNode(OldNode, Name, _
    NamespaceURI, NodeType, NodeValue)
void ReplaceChildNode(
    CustomXMLNode OldNode,
    string Name,
    string NamespaceURI,
    MsoCustomXMLNodeType NodeType,
    string NodeValue
)

Parameters

  • Name
    Type: System.String

    Represents the base name of the element to be added.

  • NodeValue
    Type: System.String

    Used to set the value of the node to be added for those nodes that allow text. If the node doesn’t allow text, the parameter is ignored.

Remarks

If the OldNode parameter is not a child of the context node or if the operation would result in an invalid tree structure, the replacement is not performed and an error message is displayed. In addition, in a case where the node to be added already exists, the replacement is not performed and an error message is displayed.

See Also

Reference

CustomXMLNode Interface

CustomXMLNode Members

Microsoft.Office.Core Namespace