Partager via


_CustomXMLPart.AddNode Method

Adds a node to the XML tree.

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

Syntax

'Declaration
Sub AddNode ( _
    Parent As CustomXMLNode, _
    Name As String, _
    NamespaceURI As String, _
    NextSibling As CustomXMLNode, _
    NodeType As MsoCustomXMLNodeType, _
    NodeValue As String _
)
'Usage
Dim instance As _CustomXMLPart
Dim Parent As CustomXMLNode
Dim Name As String
Dim NamespaceURI As String
Dim NextSibling As CustomXMLNode
Dim NodeType As MsoCustomXMLNodeType
Dim NodeValue As String

instance.AddNode(Parent, Name, NamespaceURI, _
    NextSibling, NodeType, NodeValue)
void AddNode(
    CustomXMLNode Parent,
    string Name,
    string NamespaceURI,
    CustomXMLNode NextSibling,
    MsoCustomXMLNodeType NodeType,
    string NodeValue
)

Parameters

  • Parent
    Type: Microsoft.Office.Core.CustomXMLNode

    Represents the node under which this node should be added. If adding an attribute, the parameter denotes the element that the attribute should be added to.

  • Name
    Type: System.String

    Represents the base name of the node to be added.

  • NextSibling
    Type: Microsoft.Office.Core.CustomXMLNode

    Represents the node which should become the next sibling of the new node. If not specified, the node is added to the end of the parent node’s children. This parameter is ignored for additions of type msoCustomXMLNodeAttribute. If the node is not a child of the parent, an error is displayed.

  • NodeValue
    Type: System.String

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

Remarks

If the AddNode(CustomXMLNode, String, String, CustomXMLNode, MsoCustomXMLNodeType, String) operation would result in an invalid tree structure, the append is not performed and an error message is displayed.

See Also

Reference

_CustomXMLPart Interface

_CustomXMLPart Members

Microsoft.Office.Core Namespace