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 customXML part and then deletes the part if the user clicks 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