Table of contents
Collapse the table of content
Expand the table of content

CustomXMLNode Object (Office)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Represents an XML node in a tree in a document. The CustomXMLNode object is a member of the CustomXMLNodes collection.


The CustomXMLNode object is designed to have functional parity with the IXMLDOMNode interface. In addition, it contains an XPath property, which is a great improvement over the objects provided by MSXML.


The following example selects a single node from a CustomXMLPart object by using an XPath expression and assigns it to a CustomXMLNode object.

Sub CustomXmlNodes()  
    Dim cxp1 As CustomXMLPart 
    Dim cxn As CustomXMLNode 

    With ActiveDocument 

        ' Returns the first custom xml part with the given root namespace. 
        Set cxp1 = .CustomXMLParts("urn:invoice:namespace")  

        ' Get the first node matching the XPath expression.                              
        Set cxn = cxp1.SelectSingleNode("//*[@quantity < 4]") 

    End With 

End Sub

See also


Object Model Reference

Other resources

CustomXMLNode Object Members

© 2018 Microsoft