CustomXMLParts.PartBeforeDelete event (Office)

Occurs just before a CustomXMLPart object is deleted from the CustomXMLParts collection.

Syntax

expression.PartBeforeDelete (OldPart)

expression An expression that returns a CustomXMLParts object.

Parameters

Name Required/Optional Data type Description
OldPart Required CustomXMLPart The part that is about to be deleted.

Example

The following example confirms that the user wants to delete the custom XML part, and then deletes the part if the user chooses Yes in the dialog box.

Sub CustomXMLParts_PartBeforeDelete(ByVal oldPart As CustomXMLPart) 
Dim result As Boolean 
 
result = MsgBox("Are you sure you want to delete the " & oldPart.ID & " part?", vbYesNo) 
 
If result Then 
   oldPart.Delete 
End If 
 
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.