XMLMapping Object
Word Developer Reference |
Represents the XML mapping on a ContentControl object between custom XML and a content control. An XML mapping is a link between the text in a content control and an XML element in the custom XML data store for this document.
Remarks
Use the SetMapping method to add or change the XML mapping for a content control using an XPath string. 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 |
---|
|
Use the SetMappingByNode method to add or change the XML mapping for a content control using a CustomXMLNode object. The following example does the same thing as the previous example, but uses the SetMappingByNode method.
Visual Basic for Applications |
---|
|
The following example creates a new CustomXMLPart object, loads custom XML into it, and then creates two new content controls and maps each to a different XML element within the custom XML.
Visual Basic for Applications |
---|
|
Use the Delete method to remove the XML mapping for a content control. Deleting the XML mapping for a content control deletes only the connection between the content control and the XML data. Both the content control and the XML data remain in the document. The following example deletes the XML mapping for all content controls in the active document that are currently mapped.
Visual Basic for Applications |
---|
|
Use the IsMapped property to determine if a content control is mapped to an XML node in the document's data store. The following example deletes the XML mapping for all mapped content controls in the active document.
Visual Basic for Applications |
---|
|
Use the CustomXMLNode property to access the XML node to which a content control maps. Use the CustomXMLPart property to access the XML part to which a content control maps. For more information about working with CustomXMLNode and CustomXMLPart objects, see the respective object topics.
See Also
- Word Object Model Reference
- 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