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

CustomXMLParts.SelectByNamespace Method (Office)

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

Selects the collection of custom XML parts whose namespace matches the search criteria.


expression. SelectByNamespace( NamespaceURI )

expression An expression that returns a CustomXMLParts object.


NameRequired/OptionalData TypeDescription
NamespaceURIRequiredStringContains a namespace URI.

Return Value



If no custom XML parts with this namespace exist, the method returns an empty CustomXMLParts collection object.


The following example selects all of the custom XML parts matching the namespace and then selects a node from those parts that match an XPath expression.

Dim cxp1 As CustomXMLParts 
Dim cxn As CustomXMLNode 

' Returns all of the custom xml parts with the given namespace. 
 Set cxp1 = ActiveDocument.CustomXMLParts.SelectByNamespace("urn:invoice:namespace")    

' Get the node matching the XPath expression.                              
Set cxn = cxp1(1).SelectSingleNode("//*[@supplierID = 1]") 

See also


CustomXMLParts Object

Other resources

CustomXMLParts Object Members

© 2018 Microsoft