IOpcPackage interface (msopc.h)

Represents a package and provides methods to access the package's parts and relationships.


The IOpcPackage interface inherits from the IUnknown interface. IOpcPackage also has these types of members:


The IOpcPackage interface has these methods.


Gets a part set object that contains IOpcPart interface pointers.

Gets a relationship set object that represents the Relationships part that stores package relationships.


To get a pointer to this interface, call either the IOpcFactory::CreatePackage or IOpcFactory::ReadPackageFromStream method.

Package relationships serve as an entry point to the package by links from the package to target resources. The target of a package relationship is often an important part described in the ECMA-376 OpenXML, 1st Edition, Part 2: Open Packaging Conventions (OPC) or by the package format designer.

For example, a package relationship can provide access to the Core Properties part that stores package metadata, or to a part containing format-specific data, where the part and data are described by the package designer. The Main Document part of the word processing OpenXML format is one such format-specific part. For more information about this part, see Part 1: Fundamentals in ECMA-376 OpenXML (

The definitive way to find a part of interest is by using a relationship type. Several steps are required; for details, see the Parts Overview and the Finding the Core Properties Part how-to task.

For more information about packages, see the Open Packaging Conventions Fundamentals and the OPC.

Thread Safety

Packaging objects are not thread-safe.

For more information, see the Getting Started with the Packaging API.


Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header msopc.h

See also

Core Packaging Interfaces

ECMA-376 OpenXML

External Resources

Getting Started with the Packaging API




Open Packaging Conventions Fundamentals


Packages Overview

Packaging API Reference

Packaging API Samples

Parts Overview