次の方法で共有


CustomXMLPart.SelectNodes メソッド (Office)

カスタム XML 部分からノードのコレクションを選択します。

構文

SelectNodes(XPath)

CustomXMLPart オブジェクトを返す式。

パラメーター

名前 必須 / オプション データ型 説明
XPath 必須 String XPath 式を指定します。

戻り値

CustomXMLNodes

次の例では、カスタム XML 部分を追加し、名前空間 URI に一致する部分を選択し、その部分から XPath 式に一致するノードを選択します。

Dim cxp1 As CustomXMLPart 
Dim cxn As CustomXMLNode 
 
' Add a custom xml part. 
ActiveDocument.CustomXMLParts.Add "<supplier>" 
 
' Return the first custom xml part with the given namespace. 
Set cxp1 = ActiveDocument.CustomXMLParts("urn:invoice:namespace")  
 
' Get all of the nodes matching an XPath expression. 
 Set cxns = cxp1.SelectNodes("//*[@unitPrice > 20]") 

関連項目

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。