|PowerPoint Developer Reference|
Use the Add method to add a new CustomXMLPart object to the CustomerData collection.
Use the Delete method to delete a CustomXMLPart object from the CustomerData collection.
Use the Item method to get a specific CustomXMLPart object from the collection. Individual items in the collection are represented by GUIDs (globally unique identifiers).
You can use customer data in the same way that you used Tags objects in versions of PowerPoint previous to PowerPoint 2007--that is, to associate data with objects. Customer data is more powerful than tags, however, because you can store the data as XML instead of as a simple string.
You can associate customer data in PowerPoint with external data by storing the IDs of custom XML parts in a spreadsheet or database along with the external data.
When you copy an object that contains customer data, the customer data is copied to the new object. PowerPoint creates a new CustomXMLPart object to hold the copied data, because two CustomLayout, Master, Presentation, Shape, or Slide objects can never be associated with the same CustomXMLPart object.
The following example shows how to add a CustomXMLPart object to the CustomerData collection of the first shape on the first slide of the active presentation, and how to load an XML string into the custom XML part. It prints the ID of the custom XML part and the XML string in the Immediate window.
|Visual Basic for Applications|