Table of Contents

Method SetDocumentVariable

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

SetDocumentVariable(WordDocument, string, string)

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

public static DocumentEdit SetDocumentVariable(this WordDocument document, string name, string value)

Parameters

document WordDocument

The document.

name string

The name: not empty.

value string

The value.

Returns

DocumentEdit

The edit (empty when nothing changed).

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

The name is empty, or a text holds a character XML cannot carry.

InvalidOperationException

The variables hold more than 4,096, or markup that is not a variable.