Version

CreateRelationship Method (IPackage)

Creates a package-level relationship to a part with a given URI, target mode, relationship type, and identifier (ID).
Syntax
'Declaration
 
Function CreateRelationship( _
   ByVal targetUri As Uri, _
   ByVal targetMode As RelationshipTargetMode, _
   ByVal relationshipType As String, _
   ByVal id As String _
) As IPackageRelationship

Parameters

targetUri
The uniform resource identifier (URI) of the target part.
targetMode
Indicates if the target part is System.IO.Packaging.TargetMode.Internal or System.IO.Packaging.TargetMode.External to the package.
relationshipType
A URI that uniquely defines the role of the relationship.
id
A unique XML identifier.

Return Value

The package-level relationship to the specified part.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also