CustomXMLNode.InsertNodeBefore Method
Inserts a new node just before the context node in the tree.
Namespace: Microsoft.Office.Core
Assembly: office (in office.dll)
Syntax
'Declaration
Sub InsertNodeBefore ( _
Name As String, _
NamespaceURI As String, _
NodeType As MsoCustomXMLNodeType, _
NodeValue As String, _
NextSibling As CustomXMLNode _
)
'Usage
Dim instance As CustomXMLNode
Dim Name As String
Dim NamespaceURI As String
Dim NodeType As MsoCustomXMLNodeType
Dim NodeValue As String
Dim NextSibling As CustomXMLNode
instance.InsertNodeBefore(Name, NamespaceURI, _
NodeType, NodeValue, NextSibling)
void InsertNodeBefore(
string Name,
string NamespaceURI,
MsoCustomXMLNodeType NodeType,
string NodeValue,
CustomXMLNode NextSibling
)
Parameters
Name
Type: System.StringRepresents the base name of the node to be added.
NamespaceURI
Type: System.StringRepresents the namespace of the element to be added. This parameter is required if adding nodes of type msoCustomXMLNodeElement or msoCustomXMLNodeAttribute, otherwise it is ignored.
NodeType
Type: Microsoft.Office.Core.MsoCustomXMLNodeTypeSpecifies the type of the node to be added. If the parameter is not specified, it is assumed to be a node of type msoCustomXMLNodeElement.
NodeValue
Type: System.StringUsed to set the value of the node to be added for those nodes that allow text. If the node doesn’t allow text, the parameter is ignored.
NextSibling
Type: Microsoft.Office.Core.CustomXMLNodeRepresents the context node.
Remarks
If the context node is not present when adding a node of type msoCustomXMLNodeElement, msoCustomXMLNodeComment, or msoCustomXMLNodeProcessingInstruction, the new node is added to the last child of the context node. If the operation would result in an invalid tree structure, the insertion is not performed and an error message is displayed.