Table of Contents

Method SetThemeFonts

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

SetThemeFonts(WordDocument, DocumentPosition, Action<ThemeFonts>)

Sets the theme's fonts: change gets a copy of the font scheme (its name, its heading and body font sets), and what it changes is the edit. In the theme part only the typefaces that changed are rewritten (their other attributes and every script font kept, as Word keeps them) and the scheme's name; every run that names a theme font takes the new one. ScriptFonts are not changed here.

public static DocumentEdit SetThemeFonts(this WordDocument document, DocumentPosition at, Action<ThemeFonts> change)

Parameters

document WordDocument

The document.

at DocumentPosition

Where the caret is.

change Action<ThemeFonts>

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, a Latin typeface is empty, or a typeface is longer than 31 characters or holds a control character.