IOpcPart interface (msopc.h)

Represents a part that contains data and is not a Relationships part.

Inheritance

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

Methods

The IOpcPart interface has these methods.

 
IOpcPart::GetCompressionOptions

Gets a value that describes the way part content is compressed.
IOpcPart::GetContentStream

Gets a stream that provides read/write access to part content.
IOpcPart::GetContentType

Gets the media type of part content.
IOpcPart::GetName

Gets a part URI object that represents the part name.
IOpcPart::GetRelationshipSet

Gets a relationship set object that represents the Relationships part that stores relationships that have the part as their source.

Remarks

To create a part object to represent a part, call the IOpcPartSet::CreatePart method. To get a pointer to the interface of a part object that represents an existing part, call the IOpcPartSet::GetPart or IOpcPartEnumerator::GetCurrent method.

A Relationships part cannot be represented by an implementation of the IOpcPart interface.

Methods of an IOpcPart interface provide access to part information through the properties listed in the following table:

Method Property Description
GetCompressionOptions Compression The compression option to be used on part content.
GetContentStream Content The stream of bytes that makes up the part as described in the ECMA-376 OpenXML, 1st Edition, Part 2: Open Packaging Conventions (OPC).
GetContentType Content type The media type of the part content, as specified by the package designer in compliance with the rules in the OPC.
GetName Name The URI of the part in the package.
 

For more information about parts, 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

IOpcPartSet

IStream

OPC_COMPRESSION_OPTIONS

Open Packaging Conventions Fundamentals

Overviews

Packaging API Reference

Packaging API Samples

Parts Overview

Reference