Method SetWatermark
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
documentWordDocumentThe document.
atDocumentPositionWhere the caret is (where it goes back to).
sectionSectionThe section whose pages show it.
typeHeaderFooterTypeWhich of the section's pages: Word puts it in the header of the page the caret is on.
watermarkWatermarkThe 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.