Modifica

Condividi tramite


XMLMapping.CustomXMLNode Property

Definition

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

public:
 property Microsoft::Office::Core::CustomXMLNode ^ CustomXMLNode { Microsoft::Office::Core::CustomXMLNode ^ get(); };
public Microsoft.Office.Core.CustomXMLNode CustomXMLNode { get; }
member this.CustomXMLNode : Microsoft.Office.Core.CustomXMLNode
Public ReadOnly Property CustomXMLNode As CustomXMLNode

Property Value

Examples

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.

<span class="label">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("&lt;books&gt;&lt;book&gt;" &amp; _































































































































    "&lt;author&gt;&lt;/author&gt;&lt;title&gt;&lt;/title&gt;&lt;genre&gt;&lt;/genre&gt;&lt;price&gt;&lt;/price&gt;" &amp; _































































































































    "&lt;pub_date&gt;&lt;/pub_date&gt;&lt;abstract&gt;&lt;/abstract&gt;&lt;/book&gt;&lt;/books&gt;")































































































































































































































































Set objMap = objCC.XMLMapping































































































































objMap.SetMapping "/books/book/author", , objPart































































































































































































































































Set objNode = objMap.</span>
<span class="label">CustomXMLNode</span>
<span class="label">objNode.Text = "Matt Hink"objCC.Range.Text = objNode.Text</span>

Applies to