Method SetCoreProperties
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
documentWordDocumentThe document.
atDocumentPositionA position in the document (where the edit's caret stays).
changeAction<DocumentCoreProperties>Changes the properties as they are now.
Returns
- DocumentEdit
The edit (empty when nothing changed).
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
atis not indocument, or a value holds a character XML cannot carry.