Office) (CustomXMLNode 物件

代表文件中的樹狀目錄中的 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 支援與意見反應