ZipPackage Class
Implements a derived subclass of the abstract Package base class—the ZipPackage class uses a ZIP archive as the container store. This class cannot be inherited.
Assembly: WindowsBase (in WindowsBase.dll)
| Name | Description | |
|---|---|---|
![]() | FileOpenAccess | Gets the file access setting for the package.(Inherited from Package.) |
![]() | PackageProperties | Gets the core properties of the package.(Inherited from Package.) |
| Name | Description | |
|---|---|---|
![]() | Close() | Saves and closes the package plus all underlying part streams.(Inherited from Package.) |
![]() | CreatePart(Uri^, String^) | Creates a new uncompressed part with a given URI and content type.(Inherited from Package.) |
![]() | CreatePart(Uri^, String^, CompressionOption) | Creates a new part with a given URI, content type, and compression option.(Inherited from Package.) |
![]() | CreateRelationship(Uri^, TargetMode, String^) | Creates a package-level relationship to a part with a given URI, target mode, and relationship type. (Inherited from Package.) |
![]() | CreateRelationship(Uri^, TargetMode, String^, String^) | Creates a package-level relationship to a part with a given URI, target mode, relationship type, and identifier (ID).(Inherited from Package.) |
![]() | DeletePart(Uri^) | Deletes a part with a given URI from the package.(Inherited from Package.) |
![]() | DeleteRelationship(String^) | Deletes a package-level relationship.(Inherited from Package.) |
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Flush() | Saves the contents of all parts and relationships that are contained in the package.(Inherited from Package.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetPart(Uri^) | Returns the part with a given URI.(Inherited from Package.) |
![]() | GetParts() | Returns a collection of all the parts in the package.(Inherited from Package.) |
![]() | GetRelationship(String^) | Returns the package-level relationship with a given identifier.(Inherited from Package.) |
![]() | GetRelationships() | Returns a collection of all the package-level relationships.(Inherited from Package.) |
![]() | GetRelationshipsByType(String^) | Returns a collection of all the package-level relationships that match a given RelationshipType. (Inherited from Package.) |
![]() | GetType() | |
![]() | PartExists(Uri^) | Indicates whether a part with a given URI is in the package.(Inherited from Package.) |
![]() | RelationshipExists(String^) | Indicates whether a package-level relationship with a given ID is contained in the package.(Inherited from Package.) |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IDisposable::Dispose() |
This example shows how to create a basic ZipPackage.
The example creates a package that contains a single document part which is defined as the package's root element by a package-level PackageRelationship.
The package also contains an image part and a second PackageRelationship which defines an association between the source document part and the target image part. (The image is a resource that is used with the document).
For the complete sample, see Writing a Package Sample.
Available since 3.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.



