This documentation is archived and is not being maintained.

XMLMapping.CustomXMLPart Property

Office 2007
Returns a CustomXMLPart object that represents the custom XML part to which the content control in the document maps.



expression   An expression that returns an XMLMapping object.


The following example accesses the first content control in the active document and the custom XML part to which it is mapped, and then sets the text value of one of the XML nodes contained within the custom XML part.

Bb243278.vs_note(en-us,office.12).gif  Note
This example assumes that at least one content control in the active document is mapped to a custom XML part that contains the XML nodes specified in the XPath string.
Visual Basic for Applications
Dim objCC As ContentControl
Dim objPart As CustomXMLPart
Dim objNode As CustomXMLNode

Set objCC = ActiveDocument.ContentControls(1)
Set objPart = objCC.XMLMapping.CustomXMLPart
Set objNode = objPart.SelectSingleNode("/books/book/title")
objNode.Text = "Mystery of the Empty Chair"