Version 24.2 (latest)

CreateRelationship Method (IPackagePart)

Creates a part-level relationship between this IPackagePart to a specified target IPackagePart or external resource.
Syntax
IPackageRelationship CreateRelationship( 
   System.Uri targetUri,
   RelationshipTargetMode targetMode,
   System.string relationshipType,
   System.string id
)

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 8.1, 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

View on GitHub