XmlMap Object

Microsoft Office Web Components Visual Basic

XmlMap Object

Workbook XmlMaps
XmlMap
Workbook

An XmlMap object represents the XML schema map for a Spreadsheet component. The XmlMap object is a member of the XmlMaps collection.

Using the XmlMap Object

In the XmlMaps collection, individual XmlMap objects are indexed beginning with 1 for the first object, 2 for the second object, and so on. You return a XmlMap object from the XmlMaps collection using the Item property. The argument for the Item property is the index in the collection of the object you want to return or the map ID of the object. The map ID is the value of the ID attribute in the XML that represents the map. You can find this in the XML Spreadsheet file for the part or by examining the MapData property of the XmlMap object. You can create an XML Spreadsheet file by creating a data-bound spreadsheet in Microsoft Excel and then saving the workbook as an XML Spreadsheet. You can create a new XmlMap object by using the Add method of the XmlMaps collection.

The following example shows how to work with each XmlMap object related to a Spreadsheet component. It uses the XmlMaps property of the ActiveWorkbook object to return the XmlMaps collection object:

    

Dim objMaps
Dim objMap
Dim strMapInfo

Set objMaps = Spreadsheet1.ActiveWorkbook.XmlMaps

For Each objMap in objMaps
     ' Save the XML map information to a variable.     
     strMapInfo = objMap.MapData
     ' Work with the map information XML here.
Next