View Single Post
 
Old 09-24-2018, 03:48 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,164
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

If you place a mapped Content Control into your document then you can interrogate that CC to find out its relevant details including the CustomXmlPart and xPath location.

Code:
Sub GetXPath()
  Dim aCC As ContentControl
  For Each aCC In Selection.Range.ContentControls
    Debug.Print aCC.Title, aCC.XMLMapping.XPath, aCC.XMLMapping.CustomXMLPart.NamespaceURI, aCC.XMLMapping.CustomXMLNode.BaseName
  Next aCC
End Sub
Once you have that information, you can then use the NamespaceURI to identify the right CustomXMLPart and the XPath to find the right Node in that CustomXMLPart.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote