Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

XMLMapping.CustomXMLNode Property

Office 2007
Returns a CustomXMLNode object that represents the custom XML node in the data store to which the content control in the document maps.



expression   An expression that returns an XMLMapping object.


The following example inserts a new content control and custom XML part into the active document, maps the content control to a node in the custom XML part, and then sets the value of the mapped XML node.

Visual Basic for Applications
Dim objCC As ContentControl
Dim objPart As CustomXMLPart
Dim objNode As CustomXMLNode
Dim objMap As XMLMapping

Set objCC = ActiveDocument.ContentControls.Add(wdContentControlText)
Set objPart = ActiveDocument.CustomXMLParts.Add("<books><book>" & _
    "<author></author><title></title><genre></genre><price></price>" & _

Set objMap = objCC.XMLMapping
objMap.SetMapping "/books/book/author", , objPart

Set objNode = objMap.CustomXMLNode
objNode.Text = "Matt Hink"

objCC.Range.Text = objNode.Text

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.