OpenXmlPackage.DeletePart-Methode (DataPart)
Deletes the sepcified DataPart from the document package.
Namespace: DocumentFormat.OpenXml.Packaging
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)
Syntax
'Declaration
Public Function DeletePart ( _
dataPart As DataPart _
) As Boolean
'Usage
Dim instance As OpenXmlPackage
Dim dataPart As DataPart
Dim returnValue As Boolean
returnValue = instance.DeletePart(dataPart)
public bool DeletePart(
DataPart dataPart
)
Parameter
- dataPart
Typ: DocumentFormat.OpenXml.Packaging.DataPart
The DataPart to be deleted.
Rückgabewert
Typ: System.Boolean
True if the part is successfully removed; otherwise, false. This method also returns false if the part was not found or the parameter is null.
Ausnahmen
Ausnahme | Bedingung |
---|---|
InvalidOperationException | Thrown when the dataPart is referenced by other part in the document package. |