OpenXmlPartContainer.DeletePart Method (String)

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Deletes the specified child part from this part.

Namespace:  DocumentFormat.OpenXml.Packaging
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
Public Function DeletePart ( _
    id As String _
) As Boolean
'Usage
Dim instance As OpenXmlPartContainer
Dim id As String
Dim returnValue As Boolean

returnValue = instance.DeletePart(id)
public bool DeletePart(
    string id
)

Parameters

  • id
    Type: System.String
    Specifies the relationship id of the part to be deleted.

Return Value

Type: System.Boolean
Returns true if the part is successfully removed; otherwise, it returns false. This method also returns false if the part was not found.

Exceptions

Exception Condition
ArgumentNullException

Throws an exception when the id has a null reference value.

See Also

Reference

OpenXmlPartContainer Class

OpenXmlPartContainer Members

DeletePart Overload

DocumentFormat.OpenXml.Packaging Namespace