The shapes on a slide are held in the Office Art format, specified in [MS-ODRAW] and shared by Word, Excel and PowerPoint. The records have the same 8-byte header. PowerPoint adds its own records inside the shapes.
How the records nest
0x040CDrawing the slide’s drawing containerPowerPoint0xF002OfficeArtDgContainer one drawingcontainer0xF008OfficeArtFDG how many shapes and the last shape idatom0xF003OfficeArtSpgrContainer a group of shapescontainer0xF004OfficeArtSpContainer one shape; a group nests another 0xF003container
A shape container holds:
| Record | Type | Holds |
|---|---|---|
| OfficeArtFSPGR | 0xF009 | For a group, the coordinates of its children. |
| OfficeArtFSP | 0xF00A | The shape’s id and flags. |
| OfficeArtFOPT | 0xF00B | The property table. |
| OfficeArtClientAnchor | 0xF010 | The shape’s position and size on the slide. |
| OfficeArtClientData | 0xF011 | PowerPoint’s data: placeholders, animation, links. |
| OfficeArtClientTextbox | 0xF00D | The shape’s text. |
The property table
OfficeArtFOPT has recVer 3, and recInstance gives the number of properties. Each is 6 bytes: a 16-bit identifier and a 32-bit value. Bit 14 of the identifier means the value is a picture number (an index into the picture store); bit 15 means the value is the size of extra data that follows the table.
Among the many properties, 0x0104 (pib) holds the picture of a picture shape, counted from 1; 0 means none.
Where a shape sits
Coordinates on a slide are in master units, 576 to the inch. An OfficeArtClientAnchor (0xF010) has recLen 8 (four 16-bit values) or 16 (four 32-bit values): top, left, right and bottom. A shape inside a group has an OfficeArtFChildAnchor (0xF00F) in the group’s own coordinates, which the group’s OfficeArtFSPGR gives.
OfficeArtFSP (0xF00A) has the shape type in recInstance. Types include 1 rectangle, 2 rounded rectangle, 3 ellipse, 13 right arrow, 20 line, 75 picture frame and 202 text box; type 0 is a freeform that takes its outline from properties 0x0145 and 0x0146. The record holds the shape id and flags: bit 6 flips it horizontally, bit 7 vertically, and bit 10 marks the slide’s background shape, which is the first shape of the drawing.
Some shape properties
| Id | Property | Id | Property |
|---|---|---|---|
| 0x0004 | Rotation, in 1/65536 of a degree | 0x0104 | Picture |
| 0x0081–0x0084 | Text insets, in EMUs | 0x0145, 0x0146 | Freeform vertices and segments |
| 0x0087 | Text anchor | 0x0180 | Fill type |
| 0x0181 | Fill colour | 0x0182 | Fill opacity, in 1/65536 |
| 0x0183 | Back fill colour | 0x0186 | Fill picture |
| 0x01BF | Fill flags: bit 4 filled | 0x01C0 | Line colour |
| 0x01CB | Line width, in EMUs | 0x01CE | Line dash style |
| 0x01D0, 0x01D1 | Arrowheads at each end | 0x01FF | Line flags: bit 3 line drawn |
A colour property is a 32-bit OfficeArtCOLORREF: red, green and blue in the low three bytes, and flags in the top byte. Flag 0x08 means the low byte is an index into the slide’s colour scheme.
The drawing group
The document’s DrawingGroup record (type 0x040B) holds an OfficeArtDggContainer (0xF000) with an OfficeArtFDGGBlock, which counts drawings and shapes, and the OfficeArtBStoreContainer, the store of pictures.
Reference
- [MS-ODRAW] – Microsoft’s specification of the Office Art format