Method GetDocumentVariable
GetDocumentVariable(WordDocument, string)
Gets a variable's value by its name (Word matches names ignoring case), or null.
public static string? GetDocumentVariable(this WordDocument document, string name)
Parameters
documentWordDocumentThe document.
namestringThe name.
Returns
- string
The value, or null when the document has no such variable.
Exceptions
- ArgumentNullException
An argument is null.