Table of Contents

Method FormatSettings

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

FormatSettings(WordDocument, DocumentPosition, Action<DocumentSettings>)

Changes the document's settings (settings.xml: different odd and even pages, default tab stop, …) as one undoable edit. The change runs on a copy that replaces the settings; undo puts the instance back.

public static DocumentEdit FormatSettings(this WordDocument document, DocumentPosition at, Action<DocumentSettings> change)

Parameters

document WordDocument

The document.

at DocumentPosition

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

change Action<DocumentSettings>

Sets the values on the copy.

Returns

DocumentEdit

The edit; every body, header and footer paragraph is reported changed, since settings can move every page.

Exceptions

ArgumentNullException

document or change is null.

ArgumentException

The position is not in document.