_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.CustomXMLNodeRepresents 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.StringRepresents the base name of the node to be added.
NamespaceURI
Type: System.StringRepresents the namespace of the element to be appended. This parameter is required to append nodes of type msoCustomXMLNodeElement or msoCustomXMLNodeAttribute, otherwise it is ignored.
NextSibling
Type: Microsoft.Office.Core.CustomXMLNodeRepresents 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.
NodeType
Type: Microsoft.Office.Core.MsoCustomXMLNodeTypeSpecifies the type of node to append. If the parameter is not specified, it is assumed to be of type msoCustomXMLNodeElement.
NodeValue
Type: System.StringUsed 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.