XMLMapping.SetMappingByNode Method
Word Developer Reference |
Allows creating or changing the XML data mapping on a content control. Returns True if Microsoft Office Word maps the content control to a custom XML node in the document’s custom XML data store.
Syntax
expression.SetMappingByNode(Node)
expression An expression that returns an XMLMapping object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Node | Required | CustomXMLNode | Specifies the XML node to which to map the current content control. |
Return Value
Boolean
Remarks
If the XML mapping already exists, then Word replaces the existing XML mapping, and the contents of the new mapped XML node replaces the text of the content control. See also the SetMapping method.
Note |
---|
Creating a mapping for a rich-text content control causes a run-time error. |
Example
The following example sets the built-in document property for the document author, inserts a new content control into the active document, and then sets the XML mapping for the control to the built-in document property.
Visual Basic for Applications |
---|
|
The following example creates a custom XML part, and then creates two content controls and maps each content control to a specific node within the custom XML.
Visual Basic for Applications |
---|
|
See Also
- XMLMapping Object
- XMLMapping Object Members
- How to: Bind a Content Control to a Node in the Data Store
- How to: Bind Controls to a Specific Row in the Data Store When Inserting a Building Block
- How to: Capture and Respond to Events in the Data Store
- Walkthrough: Connect an Item in the Data Store to a SQL Server Database
- Walkthrough: Connect an Item in the Data Store to a Web Service
- Walkthrough: Connect an Item in the Data Store to an Access Database
- Walkthrough: Connect an Item in the Data Store to an Excel Workbook
- Working with Content Controls