OpenXmlPartContainer.DeletePart Method (OpenXmlPart)
Deletes a specified part in the package root layer.
Namespace: DocumentFormat.OpenXml.Packaging
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)
Syntax
'宣言
Public Function DeletePart ( _
part As OpenXmlPart _
) As Boolean
'使用
Dim instance As OpenXmlPartContainer
Dim part As OpenXmlPart
Dim returnValue As Boolean
returnValue = instance.DeletePart(part)
public bool DeletePart(
OpenXmlPart part
)
Parameters
- part
Type: DocumentFormat.OpenXml.Packaging.OpenXmlPart
The part to be deleted.
Return Value
Type: 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.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | Thrown when the part is not referenced by this part. |