CustomerData.Delete method (PowerPoint)
Deletes the specified CustomXMLPart object from the CustomerData collection of a CustomLayout, Master, Presentation, Shape, or Slide object.
Syntax
expression.Delete( _Id_
)
expression An expression that returns a CustomerData object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Id | Required | String | The ID of the CustomXMLPart object to be deleted. |
Remarks
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 delete to the Id parameter of the Delete method as a String. You can get the ID of a particular custom XML part by iterating through the collection, using the Id property of the CustomerData collection.
Example
The following example shows how to use the Delete method to delete a custom XML part from the CustomerData collection. It adds a new custom XML part to the CustomerData collection of the first shape on the first slide of the active presentation. Then it gets the ID of the new part and passes it to the Delete method.
Public Sub Delete_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
' Get the current count of custom XML parts
Debug.Print pptCustomerData.Count
' Add a new CustomXMLPart object to the CustomerData
' collection for this shape and get the revised count of
' custom XML parts
Dim pptCustomXMLPart As CustomXMLPart
Set pptCustomXMLPart = pptCustomerData.Add
Debug.Print pptCustomerData.Count
' Get the ID of the new part
Dim myString As String
myString = pptCustomXMLPart.Id
Debug.Print myString
' Delete the new part and re-check the count of custom XML parts
pptCustomerData.Delete (myString)
Debug.Print pptCustomerData.Count
End Sub
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.