CustomXMLNode.AppendChildNode Method
Appends a single node as the last child under the context element node in the tree.
Note
|
|---|
| References to DTDs from custom XML parts are not supported. DTD references in custom XML parts will not resolve, and custom XML parts containing DTD references generate an exception when an attempt is made to save the file's content to a flat XML file. |
Syntax
expression.AppendChildNode(Name, NamespaceURI, NodeType, NodeValue)
expression An expression that returns a CustomXMLNode object.
Parameters
| Name | Required/Optional | Data Type | Description |
|---|---|---|---|
| Name | Optional | String | Represents the base name of the element to be appended. |
| NamespaceURI | Optional | 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. |
| NodeType | Optional | MsoCustomXMLNodeType | Specifies the type of node to append. If the parameter is not specified, it is assumed to be of type msoCustomXMLNodeElement. |
| NodeValue | Optional | 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 context node is any type other than msoXMLNodeElement, or if the operation would result in an invalid tree structure, the append is not performed and an error message is displayed.
Example
The following example demonstrates appending a CustomXMLNode object to another node.
| Visual Basic for Applications |
|---|
|
Note