Package::GetRelationshipsByType Method (String^)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Returns a collection of all the package-level relationships that match a given RelationshipType.

Namespace:   System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)

PackageRelationshipCollection^ GetRelationshipsByType(
	String^ relationshipType


Type: System::String^

The RelationshipType to match and return in the collection.

Return Value

Type: System.IO.Packaging::PackageRelationshipCollection^

A collection of package-level relationships that match the specified relationshipType.

Exception Condition

relationshipType is null.


relationshipType is an empty string.


The package is not open (Dispose or Close has been called).


The package is write-only.

GetRelationships will never return null; however the returned collection may contain zero elements if there are no package-level relationships that match the specified relationshipType.

The following table shows the package-level relationshipType URIs defined by the Open Packaging Conventions (OPC) specification.

Package-level Relationship

Relationship Type URI

Core Properties data/core-properties

Digital Signature al-signature/signature

Digital Signature Certificate al-signature/certificate

Digital Signature Origin al-signature/origin

Thumbnail data/thumbnail

For additional information, see the Open Packaging Conventions (OPC) specification available for download at

The following example shows how to retrieve the relationships that have been defined for the package. For the complete sample, see Reading a Package Sample.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top