DrawingML Object Positioning
All drawing objects for a worksheet are within one drawing part. There are as many drawing parts as there are worksheets containing drawing objects. (Note that the actual data for, e.g., an image, is stored separately, typically within a media sub-folder of the package--for Word, within a media sub-folder.)
The worksheet part will contain a <drawing> element with a relationship ID attribute referencing a relationship.
The relationships (.rels) part for the worksheet contains the relationship referencing the target drawing part.
Within the drawings part (drawing1.xml) the container element is a root <xdr:wsDr> element. The namespace for pictures within a worksheet is: xlms:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing". There are three possible child elements representing three different ways that an object can be anchored within a worksheet.
- <wp:absoluteAnchor> - used to anchor the object absolutely in the same position in the sheet; does not move or size with cells
- <wp:oneCellAnchor> - used to anchor to a single cell; moves with cells
- <wp:twoCellAnchor> - used to anchor to two cells; moves with cells