MatchSource class

Office 2013 and later

Keep Source Formatting on Import. When the object is serialized out as xml, its qualified name is w:matchSrc.

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

public class MatchSource : OnOffType

[ISO/IEC 29500-1 1st Edition]

matchSrc (Keep Source Formatting on Import)

This element specifies if any style definitions present in the imported content shall be overridden by identical styles present in the host WordprocessingML document. If this element's val attribute is true, then any style exists in both the imported content and main document shall be maintained on the imported content by redefining the style name and/or ID as needed. Conversely, if this element's val attribute is false, any style which exists in both the imported content and main document shall apply the style form the main document in place of the style in the imported content.

If this element is omitted, then styles from the main document shall override identical styles from the imported content.

[Example: Consider a WordprocessingML document consisting of contents which contains an external content import anchor in the appropriate location:

  <w:altChunk r:id="altChunk1">
      <w:matchSrc w:val="true" />
    …  </w:sectPr>

The matchSrc element has a val attribute value of true, which specifies that conflicting styles must be maintained when importing the specified content. For example, if the Heading 1 style was defined in both places, then applications must ensure that the resulting document does not lose either instance of its formatting as appropriate. end example]

Parent Elements

altChunkPr (§

This element’s content model is defined by the common boolean property definition in §17.17.4.

© ISO/IEC29500: 2008.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.