Embeddings In Line With Text

When the embedding is present in line with text, it is stored as follows:

  • The WordprocessingML <object> element specifies the presence of an embedded object in line with text.

  • The child Office VML Drawing <OLEObject> element shall specify the details about the embedding itself, including an explicit relationship to the appropriate Embedded Package or Embedded Object part.

  • The child VML <shape> element shall specify the presence of the image which may be used to represent the object.

For example, if we embed a SpreadsheetML worksheet in a WordprocessingML document, the following run content would be present:

<w:r>
  <w:object w:dxaOrig="7247" w:dyaOrig="2920">
    <v:shape id="_x0000_i1026" type="#_x0000_t75"
      style="width:362.25pt;height:146.25pt" o:ole="">
      <v:imagedata r:id="rId6" o:title="" />
    </v:shape>
    <o:OLEObject Type="Embed" ProgID="Excel.Sheet.8"
      ShapeID="_x0000_i1026" DrawAspect="Content" ObjectID="_1218026609"
      r:id="rId7" />
  </w:object>
</w:r>

If we examine this markup, it can be seen that:

  • We have an inline embedded object, as defined by the <object> element.

  • The <OLEObject> element specifies that that object is stored as an Embed, and that its ProgID is Excel.Sheet.8 (the ProgID code for Microsoft Excel worksheets); it also specifies that the associated image (when the object data cannot be used) is stored in the VML shape with a shape ID of _x0000_i1026.

  • The associated VML <shape> element with an @id attribute value of _x0000_i1026 shall be used in place of the object whenever it is not loaded - this shape is typically, but is not required to be, stored in the same <object> element as the <OLEObject> element. This shape specifies its desired size and provides an explicit relationship to the part that stores the image data.