Share via


OpenXmlPackage.DeletePart(DataPart) Method

Definition

Deletes the specified DataPart from the document package.

public bool DeletePart (DocumentFormat.OpenXml.Packaging.DataPart dataPart);
override this.DeletePart : DocumentFormat.OpenXml.Packaging.DataPart -> bool
Public Function DeletePart (dataPart As DataPart) As Boolean

Parameters

dataPart
DataPart

The DataPart to be deleted.

Returns

Returns true if the part is successfully removed; otherwise returns false. This method also returns false if the part was not found or the parameter is null.

Exceptions

Thrown when dataPart is referenced by another part in the document package.

Applies to