Table of Contents

Cover pages

A cover page at the start of a document, as Word's Insert > Cover Page puts one: in Word's Cover Pages content control, on a page of its own. The designs are DocWright's own; Word's gallery is Microsoft's and is not included.

using DocWright.Dom.Editing;

CoverPageDesign design = CoverPageGallery.Find("Ruled")!;   // Centered, Ruled, Banner
DocumentEdit edit = document.InsertCoverPage(caret, design);
bool has = document.HasCoverPage();
document.RemoveCoverPage(caret);                           // Word's Remove Current Cover Page
  • The cover is the first block of the body: a w:docPartObj control in the "Cover Pages" gallery with w:docPartUnique, ending in a page break inside the control, so the document goes on from page 2 and removing the cover leaves no empty page.
  • Inserting another cover replaces the one the document has. Each insert and remove is one undo step.
  • The title, subtitle, author and company are plain-text controls bound to the document's properties (title, subject, author, company), as Word binds its own covers. They show the values, or a grey placeholder when one is empty; typing on them sets the property, and changing the property updates them. See Forms.
  • The designs use the theme's accent colour, so they follow a theme change.

Word opens these covers as its own: the fields bound, the document on page 2.