Table of Contents

Method SetThemeColors

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

SetThemeColors(WordDocument, DocumentPosition, Action<ThemeColorScheme>)

Sets the theme's colours: change gets a copy of the colour scheme (its name and its twelve slots), and what it changes is the edit. In the theme part only the slots that changed are rewritten (as a:srgbClr, a system colour too) and the scheme's name; every colour of the document that names a theme slot is drawn in the new colour and has its cached RGB rewritten, as Word does.

public static DocumentEdit SetThemeColors(this WordDocument document, DocumentPosition at, Action<ThemeColorScheme> change)

Parameters

document WordDocument

The document.

at DocumentPosition

Where the caret is (the edit changes no text; it is where the caret goes back to).

change Action<ThemeColorScheme>

Changes the copy.

Returns

DocumentEdit

The edit; empty when nothing changed.

Exceptions

ArgumentNullException

document or change is null.

ArgumentException

The position is not in the document, or a slot is set to auto.