OpenXmlPartContainer.AddExternalRelationship Method (String, Uri, 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.

Adds an external relationship.

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

Syntax

'Declaration
Public Function AddExternalRelationship ( _
    relationshipType As String, _
    externalUri As Uri, _
    id As String _
) As ExternalRelationship
'Usage
Dim instance As OpenXmlPartContainer
Dim relationshipType As String
Dim externalUri As Uri
Dim id As String
Dim returnValue As ExternalRelationship

returnValue = instance.AddExternalRelationship(relationshipType, _
    externalUri, id)
public ExternalRelationship AddExternalRelationship(
    string relationshipType,
    Uri externalUri,
    string id
)

Parameters

  • relationshipType
    Type: System.String
    Specifies the relationship type.
  • externalUri
    Type: System.Uri
    Specifies the external URI.

Return Value

Type: DocumentFormat.OpenXml.Packaging.ExternalRelationship
Returns an ExternalRelationship with the relationship ID.

Exceptions

Exception Condition
ArgumentNullException

Throws an exception when the relationshipType or the externalUri have a null reference value.

See Also

Reference

OpenXmlPartContainer Class

OpenXmlPartContainer Members

AddExternalRelationship Overload

DocumentFormat.OpenXml.Packaging Namespace