Share via


XMLMapping.CustomXMLPart Property

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

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
ReadOnly Property CustomXMLPart As CustomXMLPart
    Get
'Usage
Dim instance As XMLMapping
Dim value As CustomXMLPart

value = instance.CustomXMLPart
CustomXMLPart CustomXMLPart { get; }

Property Value

Type: CustomXMLPart

Examples

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.

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.

Dim objCC As ContentControl































































































































Dim objPart As CustomXMLPart































































































































Dim objNode As CustomXMLNode































































































































































































































































Set objCC = ActiveDocument.ContentControls(1)































































































































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

See Also

Reference

XMLMapping Interface

XMLMapping Members

Microsoft.Office.Interop.Word Namespace