Table of Contents

Class CustomPropertiesEditingExtensions

Namespace
DocWright.Word.Editing
Assembly
DocWright.Word.dll

The document's custom properties (docProps/custom.xml, Phase 222) read, set and removed, each change one undoable edit of the part. The value rules are the package's (CustomPropertyValues in Core, shared with workbooks); the part is edited as XML in place: a property not touched keeps its every attribute and child.

public static class CustomPropertiesEditingExtensions
Inheritance
CustomPropertiesEditingExtensions
Inherited Members

Fields

MaxNameLength

The longest name Word keeps (measured: a longer one is cut to 255 characters; here it is refused).

PartUri

The part's URI.

Methods

GetCustomProperty(WordDocument, string)

Finds a custom property by its name, ignoring case as Word does.

ReadCustomProperties(WordDocument)

Reads the document's custom properties, in the part's order (at most 4,096 are listed).

RemoveCustomProperty(WordDocument, DocumentPosition, string)

Removes a custom property (named in any case); the part and its relationship go with the last one.

SetCustomProperty(WordDocument, DocumentPosition, string, bool)

Sets a yes-or-no property (vt:bool).

SetCustomProperty(WordDocument, DocumentPosition, string, DateTime)

Sets a date property (vt:filetime), stored in UTC to the second: a local time is converted, one of unspecified kind is taken as UTC.

SetCustomProperty(WordDocument, DocumentPosition, string, double)

Sets a number property (vt:r8, its round-trip form).

SetCustomProperty(WordDocument, DocumentPosition, string, int)

Sets a whole-number property (vt:i4).

SetCustomProperty(WordDocument, DocumentPosition, string, string)

Sets a text property, adding it when the document has none of that name (in any case).