Freigeben über


OpenXmlPartContainer.CreateRelationshipToPart-Methode (OpenXmlPart)

Adds relationship for the specified part to this part.

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

Syntax

'Declaration
Public Function CreateRelationshipToPart ( _
    targetPart As OpenXmlPart _
) As String
'Usage
Dim instance As OpenXmlPartContainer
Dim targetPart As OpenXmlPart
Dim returnValue As String

returnValue = instance.CreateRelationshipToPart(targetPart)
public string CreateRelationshipToPart(
    OpenXmlPart targetPart
)

Parameter

Rückgabewert

Typ: System.String
A unique relationship identifier.

Ausnahmen

Ausnahme Bedingung
ArgumentNullException

Thrown when "part" or the "id" is null reference.

ArgumentOutOfRangeException

Thrown when the part is no allowed to be added.

OpenXmlPackageException

Thrown when one instance of same type part already exists and multiple instance of that type is not allowed.

InvalidOperationException

Thrown when the targetPart and this part are not in the same OpenXmlPackage.

Siehe auch

Referenz

OpenXmlPartContainer Klasse

OpenXmlPartContainer-Member

CreateRelationshipToPart Überladung

DocumentFormat.OpenXml.Packaging-Namespace