Returning the GUID of an unknown CustomXMLPart in PowerPoint's CustomerData object
I'm experimenting with saving custom XML data to [shape] objects in PowerPoint using the object's CustomerData collection object which stores one or more CustomXML parts. There are three main methods and one property for the CustomerData object:
Unlike other collections in the OM, items in the collection are read using a GUID string rather than a numerical index. for example:
Sub TestReadXML() Dim GUID As String GUID = "{CBAC284D-9000-4CFE-8E8F-FAD5CC8BCAA7}" With ActiveWindow.Selection.ShapeRange(1).CustomerData With .Item(GUID) Debug.Print .XML End With End WithEnd Sub
The GUID is created automatically by the .Add method when the CusomXMLPart is initially created so at that point it can be read and saved:
Sub TestWriteXML() Dim GUID As String With ActiveWindow.Selection.ShapeRange(1).CustomerData With .Add GUID = .Id .LoadXML "<testXML/>" End With End WithEnd Sub
Now, given the fact that the GUID cannot be present in more than one CustomXMLPart, either for the same object or multiple objects, when an object that contains a CustomXMLPart is copied, the original maintains its GUID but the copy is assigned a new one automatically.
Let's say I have a shape selected in the example above and I add the XML part, then copy/paste the shape, the new shape has been assigned the same XML data but with a different GUID.
How can I find out what that new GUID is?!
Is it deliberately inaccessible for security reasons or is this just an incomplete part of the PowerPoint OM?