ContentControl.XMLMapping property (Word)
Returns an XMLMapping object that represents the mapping of a content control to XML data in the data store of a document. Read-only.
Syntax
expression. XMLMapping
expression An expression that returns a ContentControl object.
Example
The following example sets the built-in Author document property and adds a new content control to the active document, and then sets the mapping for the control to the value of the built-in document property.
Dim objCC As ContentControl
Dim objMap As XMLMapping
Dim blnMap As Boolean
ActiveDocument.BuiltInDocumentProperties("Author").Value = "David Jaffe"
Set objCC = ActiveDocument.ContentControls.Add _
(wdContentControlText, ActiveDocument.Paragraphs(1).Range)
Set objMap = objCC.XMLMapping
blnMap = objMap.SetMapping(XPath:="/ns1:coreProperties[1]/ns0:creator[1]")
If blnMap = False Then
MsgBox "Unable to map the content control."
End If
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.