CustomXMLNode 对象 (Office)

表示文档中的树中的 XML 节点。 CustomXMLNode 对象是 CustomXMLNodes 集合的成员。

备注

CustomXMLNode 对象设计为具有与 IXMLDOMNode 接口的功能奇偶一性。 此外,它还包含 XPath 属性,这比 MSXML 提供的对象有了很大的改进。

示例

以下示例通过使用 XPath 表达式从 CustomXMLPart 对象中选择单个节点,并将它分配给 CustomXMLNode 对象。

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

另请参阅

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。