Version

CreateRelationship Method (IPackagePart)

Creates a part-level relationship between this IPackagePart to a specified target IPackagePart or external resource.
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 URI of the target part.
targetMode
One of the enumeration values. For example, RelationshipTargetMode.Internal if the target part is inside the IPackage; or RelationshipTargetMode.External if the target is a resource outside the IPackage.
relationshipType
The role of the relationship.
id
A unique ID for the relationship.

Return Value

The part-level relationship between this IPackagePart to the target IPackagePart or external resource.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, 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