<subDoc> (Anchor for Subdocument Location)

This element specifies a location within a master document for the insertion of the contents of a specified subdocument. The specified subdocument's contents should appear at the specified location within the master document as needed, but shall remain part of the separate file specified by the subdocument location. The location of the subdocument shall be specified by the relationship whose @Id attribute matches the @id attribute on this element.

If the relationship type of the relationship specified by this element is not http://schemas.openxmlformats.org/officeDocument/2006/subDocument, is not present, or does not have a @TargetMode attribute value of External, then the document shall be considered non-conformant.


The resulting master document would consist of its own WordprocessingML content as well as subdocument anchors in the appropriate locations:

      <w:t>My Book</w:t>
      <w:t>Once upon a time…</w:t>
  <w:subDoc r:id="subDocRel1" />
  <w:subDoc r:id="subDocRel2" />

The two <subDoc> elements specify that the subdocuments targeted by the relationships with an ID of subDocRel1 and subDocRel2 shall be imported in that order after the content of the first two paragraphs of content. Examining the contents of the corresponding relationship part item, we can see the targets for those relationships:

<Relationships  ><Relationship Id="subDocRel1" TargetMode="External" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/subDocument" Target="Chapter1.docx" />
  <Relationship Id="subDocRel2" TargetMode="External" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/subDocument" Target="Chapter2.docx" /></Relationships>

The corresponding relationship part item shows that the two files to be imported are located in the same location as the current file and name Chapter1.docx and Chapter2.docx respectively. ]

Parent Elements

<customXml>; <fldSimple>2.16.21); <hyperlink>2.16.24); <p>; <sdtContent>; <smartTag>



<id> (Relationship to Part)

Namespace: .../officeDocument/2006/relationships

Specifies the relationship ID to a specified part.

The specified relationship shall match the type required by the parent element:

  • http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer for the <footerReference> element

  • http://schemas.openxmlformats.org/officeDocument/2006/relationships/header for the <headerReference> element

  • http://schemas.openxmlformats.org/officeDocument/2006/relationships/font for the <embedBold>, <embedBoldItalic>, <embedItalic>, or< embedRegular> elements

  • http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings for the <printerSettings> element

<… r:id="rId10" />

The markup specifies the associated relationship part with relationship ID rId1 contains the corresponding relationship information for the parent XML element. ]

The possible values for this attribute are defined by the ST_RelationshipId simple type (§

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_Rel">
	<attribute ref="r:id" use="required"/>