Edit

Share via


_CustomXMLPart.AddNode Method

Definition

Adds a node to the XML tree.

public void AddNode (Microsoft.Office.Core.CustomXMLNode Parent, string Name = "", string NamespaceURI = "", Microsoft.Office.Core.CustomXMLNode NextSibling = default, Microsoft.Office.Core.MsoCustomXMLNodeType NodeType = Microsoft.Office.Core.MsoCustomXMLNodeType.msoCustomXMLNodeElement, string NodeValue = "");
abstract member AddNode : Microsoft.Office.Core.CustomXMLNode * string * string * Microsoft.Office.Core.CustomXMLNode * Microsoft.Office.Core.MsoCustomXMLNodeType * string -> unit
Public Sub AddNode (Parent As CustomXMLNode, Optional Name As String = "", Optional NamespaceURI As String = "", Optional NextSibling As CustomXMLNode = Nothing, Optional NodeType As MsoCustomXMLNodeType = Microsoft.Office.Core.MsoCustomXMLNodeType.msoCustomXMLNodeElement, Optional NodeValue As String = "")

Parameters

Parent
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
String

Represents the base name of the node to be added.

NamespaceURI
String

Represents 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
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.

NodeType
MsoCustomXMLNodeType

Specifies the type of node to append. If the parameter is not specified, it is assumed to be of type msoCustomXMLNodeElement.

NodeValue
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.

Applies to