At the time of writing, Microsoft has defined only a single standard property set, Summary Information. This property set is defined as a stream named "\005SummaryInformation" (saving it as a storage is not allowed), and its FMTID is F29F85E0-4FF9-1068-AB91-08002B27B3D9. As we described earlier, a specific property set defines the meaning of each property within it and assigns the PIDs. Those for Summary Information are listed in Table 16-2.
Property Name | Property ID | PID | Type |
Title | PID_TITLE | 2 | VT_LPSTR |
Subject | PID_SUBJECT | 3 | VT_LPSTR |
Author | PID_AUTHOR | 4 | VT_LPSTR |
Keywords | PID_KEYWORDS | 5 | VT_LPSTR |
Comments | PID_COMMENTS | 6 | VT_LPSTR |
Template | PID_TEMPLATE | 7 | VT_LPSTR |
Last Saved By | PID_LASTAUTHOR | 8 | VT_LPSTR |
Revision Number | PID_REVNUMBER | 9 | VT_LPSTR |
Total Editing Time | PID_EDITTIME | 10 | VT_FILETIME |
Last Printed | PID_LASTPRINTED | 11 | VT_FILETIME |
Create Time/Date | PID_CREATE_DTM | 12 | VT_FILETIME |
Last Saved Time/Date | PID_LASTSAVE_DTM | 13 | VT_FILETIME |
Number of Pages | PID_PAGECOUNT | 14 | VT_I4 |
Number of Words | PID_WORDCOUNT | 15 | VT_I4 |
Number of Characters | PID_CHARCOUNT | 16 | VT_I4 |
Thumbnail | PID_THUMBNAIL | 17 | VT_CF |
Name of Creating Application | PID_APPNAME | 18 | VT_LPSTR |
Security | PID_SECURITY | 19 | VT_I4 |
Table 16-2.
The Summary Information property set.
PID_CREATE_DTM is considered a read-only value once it is present in a property set. In other words, the creation date of whatever file this property set is attached to is determined only once. No one has the need to change the value later. Also, PID_THUMBNAIL should contain a metafile or bitmap (device-dependent or device-independent); a metafile is recommended. A final note is that PID_SECURITY is a set of suggested access-control flags, shown in the following table. The code that reads the property set and the document should honor these flags:
Security Level | Value |
None | 0 |
Password protected | 1 |
Read-only recommended | 2 |
Read-only enforced | 4 |
Locked for annotations | 8 |
The way an application obtains much of the information that it writes into this property set is up to that application. Various applications in Microsoft Office have a Summary Info command on the File menu; choosing this command displays a dialog box in which the user can enter most of the string-related information. Information such as word count and a thumbnail sketch can be obtained without the user's direct input.
Regardless of how an application obtains the information, Microsoft is strongly encouraging developers of applications that write information into compound files to include the Summary Information property set as a stream underneath the file's root storage. And for good reasons. Historically, the properties contained in Summary Information have always been wrapped inside an application's proprietary file format. If a user wanted to view or otherwise use that information, he or she had to run the application that created it. Besides simply looking at the information, users often search for files on the basis of a set of criteria, such as "search for all documents written by Terry White after 6/17/94 that contain the phrases 'west region' or 'central region' in either the title, subject, or keywords." When summary information data is locked in a proprietary file format, users have to search through each application's file type individually, a tedious process at best.
To facilitate systemwide document searches, Microsoft has used OLE's Property Sets and Compound Files to specify a standard structure for this information (the property set) and a standard place to store it (the compound file). Any application can retrieve these properties and use them for display or searching purposes. The Windows 95 Explorer, for example, allows you to view the summary information attached to any compound file without running the application that created that file. Future versions of Windows will use this information to perform file searches. In such a system, the shell allows the user to specify criteria that are then matched against summary information to generate a list of matching files. All of this happens quickly because there is no need to load more than a small block of data from any file.