Table of Contents

Class DocumentVariableEditingExtensions

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

The document's variables (w:docVars in word/settings.xml, Phase 222): named text a DOCVARIABLE field shows, set by macros and add-ins and never shown in Word's dialogs (DocIO's Variables). Read, set and removed, each change one undoable edit of the settings' preserved w:docVars element; the other settings are not touched.

public static class DocumentVariableEditingExtensions
Inheritance
DocumentVariableEditingExtensions
Inherited Members

Methods

GetDocumentVariable(WordDocument, string)

Gets a variable's value by its name (Word matches names ignoring case), or null.

ReadDocumentVariables(WordDocument)

Reads the document's variables, in the order the settings state them.

RemoveDocumentVariable(WordDocument, string)

Removes a variable (named in any case); the element goes with the last one.

SetDocumentVariable(WordDocument, string, string)

Sets a variable, adding it at the end when the document has none of that name.