Table of Contents

Method SetWatermark

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

SetWatermark(WordDocument, DocumentPosition, Section, HeaderFooterType, Watermark)

Sets the document's watermark: every watermark it has goes, and the header in effect for section's pages of type (the section's own, or the one it links to; a header is added to the section when there is none) gets this one at its start, in Word's Watermarks content control. One undo step.

public static DocumentEdit SetWatermark(this WordDocument document, DocumentPosition at, Section section, HeaderFooterType type, Watermark watermark)

Parameters

document WordDocument

The document.

at DocumentPosition

Where the caret is (where it goes back to).

section Section

The section whose pages show it.

type HeaderFooterType

Which of the section's pages: Word puts it in the header of the page the caret is on.

watermark Watermark

The watermark.

Returns

DocumentEdit

The edit.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

The position or the section is not in the document; the text is empty, longer than 255 characters or holds a control character; the font is empty; a side of the box is not 1 EMU to 22 inches; or the colour is auto.