OpenXmlPartContainer.CreateRelationshipToPart Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CreateRelationshipToPart(OpenXmlPart) |
Adds a relationship for the specified part to this part. |
CreateRelationshipToPart(OpenXmlPart, String) |
Adds a relationship for the specified part to this part. |
CreateRelationshipToPart(OpenXmlPart)
Adds a relationship for the specified part to this part.
public string CreateRelationshipToPart (DocumentFormat.OpenXml.Packaging.OpenXmlPart targetPart);
member this.CreateRelationshipToPart : DocumentFormat.OpenXml.Packaging.OpenXmlPart -> string
Public Function CreateRelationshipToPart (targetPart As OpenXmlPart) As String
Parameters
- targetPart
- OpenXmlPart
The part to add relationship for.
Returns
A unique relationship identifier.
Exceptions
Thrown when "part" or the "id" is null reference.
Thrown when the part is no allowed to be added.
Thrown when one instance of same type part already exists and multiple instance of that type is not allowed.
Thrown when the targetPart
and this part are not in the same OpenXmlPackage.
Applies to
CreateRelationshipToPart(OpenXmlPart, String)
Adds a relationship for the specified part to this part.
public string CreateRelationshipToPart (DocumentFormat.OpenXml.Packaging.OpenXmlPart targetPart, string id);
member this.CreateRelationshipToPart : DocumentFormat.OpenXml.Packaging.OpenXmlPart * string -> string
Public Function CreateRelationshipToPart (targetPart As OpenXmlPart, id As String) As String
Parameters
- targetPart
- OpenXmlPart
The part to add a relationship for.
- id
- String
A unique relationship identifier.
Returns
A unique relationship identifier.
Exceptions
Thrown when "part" or the "id" is null reference.
Thrown when the part is no allowed to be added.
Thrown when one instance of same type part already exists and multiple instance of that type is not allowed.
Thrown when the targetPart
and this part are not in the same OpenXmlPackage.