OpenXmlPartContainer.ChangeIdOfPart Method

Changes the relationship ID of the part.

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

Syntax

'Declaration
Public Function ChangeIdOfPart ( _
    part As OpenXmlPart, _
    newRelationshipId As String _
) As String
'Usage
Dim instance As OpenXmlPartContainer
Dim part As OpenXmlPart
Dim newRelationshipId As String
Dim returnValue As String

returnValue = instance.ChangeIdOfPart(part, _
    newRelationshipId)
public string ChangeIdOfPart(
    OpenXmlPart part,
    string newRelationshipId
)

Parameters

  • newRelationshipId
    Type: System.String
    The new relationship ID of the part.

Return Value

Type: System.String
The old relationship ID of the part.

Exceptions

Exception Condition
ArgumentNullException

Throw when "part" is null reference or the newRelationshipId is null reference.

ArgumentOutOfRangeException

Thrown when the part does not exist under this part.

ArgumentException

Thrown when the specified relationship id is already used by another part.

See Also

Reference

OpenXmlPartContainer Class

OpenXmlPartContainer Members

DocumentFormat.OpenXml.Packaging Namespace