Table of contents
Collapse the table of content
Expand the table of content

CustomerData.Item Method (PowerPoint)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Returns the specified CustomXMLPart object from the CustomerData collection. Read-only.


expression. Item( Id )

expression An expression that returns a CustomerData object.


NameRequired/OptionalData TypeDescription
IdRequiredStringThe ID of the CustomXMLPart object.

Return Value



Individual CustomXMLPart objects in the CustomerData collection are represented by GUIDs (globally unique identifiers). Pass the GUID that represents the custom XML part that you want to get to the Id parameter of the Item method as a String. You can get the ID of a particular custom XML part by getting the value of the Id property of the CustomXMLPart object.


The following example shows how to use the Item method to get a custom XML part by its ID string.

Public Sub Item_Example() 

    Dim pptSlide As Slide 
    Set pptSlide = ActivePresentation.Slides(1) 

    Dim pptShape As Shape 
    Set pptShape = pptSlide.Shapes(1) 

    ' Get the CustomerData collection of the shape 
    Dim pptCustomerData As customerData 
    Set pptCustomerData = pptShape.customerData 

    ' Add a new CustomXMLPart object to the 
    ' CustomerData collection for this shape 
    Dim pptCustomXMLPart As CustomXMLPart 
    Set pptCustomXMLPart = pptCustomerData.Add 

    ' Get the ID of the new part 
    Dim myString As String 
    myString = pptCustomXMLPart.Id 
    Debug.Print myString 

    ' Get the new part from the collection by its Id 
    ' and load XML into the part 
    pptCustomerData.Item(myString).LoadXML ("<text>This is XML data.</text>") 
    Debug.Print pptCustomXMLPart.xml 

End Sub

See also


CustomerData Collection

© 2018 Microsoft