Table of Contents

Method SetCoreProperties

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

SetCoreProperties(WordDocument, DocumentPosition, Action<DocumentCoreProperties>)

Changes the document's core properties as one undoable edit. A property set to null is removed from the part, one set to an empty string is written empty (as Word writes a cleared property); everything else in the part stays. A document without the part gets one. No paragraph changes: the layout is not affected.

public static DocumentEdit SetCoreProperties(this WordDocument document, DocumentPosition at, Action<DocumentCoreProperties> change)

Parameters

document WordDocument

The document.

at DocumentPosition

A position in the document (where the edit's caret stays).

change Action<DocumentCoreProperties>

Changes the properties as they are now.

Returns

DocumentEdit

The edit (empty when nothing changed).

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

at is not in document, or a value holds a character XML cannot carry.