The OLE compound file storage object implementation includes an implementation of both IPropertyStorage, the interface that manages a single persistent property set, and IPropertySetStorage, the interface that manages groups of persistent property sets.
To get a pointer to the compound file implementation of IPropertySetStorage, first call StgCreateDocfile to create a new compound file object or StgOpenStorage to open a previously created compound file. Both functions supply a pointer to the object's IStorage interface. When you want to deal with persistent property sets, call IStorage::QueryInterface for the IPropertySetStorage interface, specifying the header-defined name for the interface identifier IID_IPropertySetStorage.
Call the methods of IPropertySetStorage to create, open, or delete property sets in the current compound file property set storage. There is also a method that supplies a pointer to an enumerator that can be used to enumerate the property sets in the storage.
Note The DocumentSummaryInformation property set is special, in that it may have two property set sections. This property set is described in the OLE Programmer's Reference, in the section titled The DocumentSummaryInformation Property Set. The second section is referred to as the User-Defined Properties. Each section is identified with a unique Format ID, for example FMTID_DocumentSummaryInformation and FMTID_UserDefinedProperties.
When IPropertySetStorage::Create is called to create the User-Defined Property Set, the first section is created automatically. Thus once FMTID_UserDefinedProperties is created, FMTID_DocumentSummaryInformation need not be created, but can be opened with a call to IPropertySetStorage::Open. Note that creating the first section does not automatically create the second section. It is not possible to open both sections simultaneously.
When IPropertySetStorage::Create is called to create the User-Defined Property Set, the first section is created automatically. Thus once FMTID_UserDefinedProperties is created, FMTID_DocumentSummaryInformation need not be created, but can be opened with a call to IPropertySetStorage::Open. Note that creating the first section does not automatically create the second section. It is not possible to open both sections simultaneously.
Alternately, when IPropertySetStorage::Delete is called to delete the first section, both sections are deleted. That is, calling IPropertySetStorage::Delete with FMTID_DocumentSummaryInformation, causes both that section and the FMTID_UserDefinedProperties section to be deleted. Note that deleting the second section does not automatically delete the first section.
Finally, when IPropertySetStorage::Enum is used to enumerate property sets, the User-Defined Property Set will not be enumerated.
IPropertyStorage, IPropertySetStorage - Compound File Implementation, STATPROPSETSTG structure, PROPSETFLAG enumeration, IStorage::EnumElements