Method SetThemeColors
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
documentWordDocumentThe document.
atDocumentPositionWhere the caret is (the edit changes no text; it is where the caret goes back to).
changeAction<ThemeColorScheme>Changes the copy.
Returns
- DocumentEdit
The edit; empty when nothing changed.
Exceptions
- ArgumentNullException
documentorchangeis null.- ArgumentException
The position is not in the document, or a slot is set to
auto.