IOpcPackage interface (msopc.h)

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

Inheritance

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

Methods

The IOpcPackage interface has these methods.

 
IOpcPackage::GetPartSet

Gets a part set object that contains IOpcPart interface pointers.
IOpcPackage::GetRelationshipSet

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

Remarks

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 (https://www.ecma-international.org/publications-and-standards/standards/ecma-376/).

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.

Requirements

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

IOpcFactory

IOpcPartSet

IOpcRelationshipSet

Open Packaging Conventions Fundamentals

Overviews

Packages Overview

Packaging API Reference

Packaging API Samples

Parts Overview

Reference