_CustomXMLPart.AddNode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應