Table of Contents

Method SetDocumentDefaults

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

SetDocumentDefaults(WordDocument, DocumentPosition, Action<DocDefaults>)

Changes the document's defaults, Manage Styles > Set Defaults (Phase 150, WQ-0123): change runs on a copy of DocDefaults (w:docDefaults) that replaces it. Every style resolves over the defaults, so every paragraph of the body, the headers and footers and the notes is reported changed. Styles and direct formatting are not touched.

public static DocumentEdit SetDocumentDefaults(this WordDocument document, DocumentPosition at, Action<DocDefaults> change)

Parameters

document WordDocument

The document.

at DocumentPosition

Where the caret is: the edit's Before and After.

change Action<DocDefaults>

Changes the copy: its CharacterFormat and ParagraphFormat.

Returns

DocumentEdit

The edit.

Exceptions

ArgumentNullException

document or change is null.

ArgumentException

The position is not in the document.