Freigeben über


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

    Represents the base name of the node to be added.

  • NodeValue
    Type: System.String

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

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.

See Also

Reference

CustomXMLNode Interface

CustomXMLNode Members

Microsoft.Office.Core Namespace