Method SetThemeFonts
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
documentWordDocumentThe document.
atDocumentPositionWhere the caret is.
changeAction<ThemeFonts>Changes the copy.
Returns
- DocumentEdit
The edit; empty when nothing changed.
Exceptions
- ArgumentNullException
documentorchangeis 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.