SwapBordersFacingPages class

Office 2013 and later

Swap Paragraph Borders on Odd Numbered Pages. When the object is serialized out as xml, its qualified name is w:swapBordersFacingPages.

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

public class SwapBordersFacingPages : OnOffType

[ISO/IEC 29500-1 1st Edition]

swapBordersFacingPages (Swap Paragraph Borders on Odd Numbered Pages)

This element specifies whether left and right paragraph borders defined under the pBdr element (Part 1, § shall be swapped under conditions where it is possible that the those pages are intended to be used to create a book-like publication.

Typically, no changes shall be made to the positions of paragraph borders defined under the pBdr element - a right border is always on the right, and a left border is always on the left. This element, when present with a val attribute value of true (or equivalent), specifies that under the two following conditions:

  • The margins in this document are mirrored using the mirrorMargins element (Part 1, §

  • The header/footers in this document are different on even and odd numbered pages using the evenAndOddHeaders element (Part 1, §17.10.1)

That paragraph borders on odd-numbered pages are swapped - that is, left borders shall be displayed on the right and right borders shall be displayed on the left.

[Example: Consider a WordprocessingML document for which the mirrorMargins element is present, and whose default paragraph style includes a paragraph border to be displayed on the right side of each paragraph:

<w:style w:type="paragraph" w:default="1" w:styleId="Normal" >
  …  <w:pPr>
      <w:right w:val="single" w:color="auto" />
    …  </w:pPr>

If a two-page document is created using this default paragraph style, then all paragraphs has a border on the right side, as follows:

However, if this compatibility setting is turned on:

  <w:swapBordersFacingPages />

Then the borders on the first page (being an odd-numbered page) must be swapped, resulting in the following output:

end example]

Parent Elements

compat (Part 1, §

This element’s content model is defined by the common boolean property definition in Part 1, §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.