Shape Properties msofbtOPT
The first part of an OPT record is an array of FOPTEs, consisting of ID-value pairs tightly packed:
typedef struct _FOPTE
{
struct
{
USHORT pid : 14; // Property ID
USHORT fBid : 1; // value is a blip ID – only valid if fComplex is FALSE
USHORT fComplex : 1; // complex property, value is length
};
ULONG op; // Value
} FOPTE;
The FOPTE array is sorted by property ID.
Some property values, such as Unicode strings, don't fit in 32 bits. For these properties, the fComplex bit is set in the FOPTE, and the length of the data is saved in the value slot. The data of the complex properties follows the FOPTE array in the file record (sorted by property ID).
BLIPs are usually saved in the BLIP Store, so, in most cases, BLIP properties just store a BLIP ID (basically an index into an array in the BLIP Store). This is signaled by the fBid flag; note however that this flag is only valid if fComplex is FALSE.
Boolean properties are grouped in bitfields by property set; note that the Boolean properties in each property set below are contiguous. They are saved under the property ID of the last Boolean property in the set, and are placed in the value field in reverse order starting with the last property in the low bit.
Notes on types and units:
- MSOHSP properties are basically just pointers to shapes, and they are therefore saved as SPIDs.
- WCHAR* properties are Unicode strings; char* properties are ASCII strings.
- IMsoArray properties are arrays. They are always complex when non-NULL. The complex-data part is saved as three shorts (16 bits each) followed by the array data. The first short is the number of elements in the array; the second short is the number of elements allocated for the array in memory (always greater than or equal to the first short); and the third short is the size of each array element.
- Absolute distances are specified in English Metric Units (EMUs), occasionally referred to as A units; there are 360000 EMUs per centimeter, 914400 EMUs per inch, 12700 EMUs per point.
- A coordinate space relative to the size of the shape is specified with the geoLeft, geoTop, geoRight, and geoBottom properties; coordinates in this space are said to be in G units.
- Many quantities are specified as fixed-point 16.16 numbers; that is, the quantity fits in a LONG, where the high word specifies the integer part and the low word specifies the fractional part. In this system, 1<<16 signifies 1, 1<<17 signifies 2, and 1<<15 signifies ½.
The property listings below contain only those properties which are saved in OPT records in the file. Properties which are never saved, or which appear elsewhere in the file format, have been omitted.