Dear reader,
My application allows the user to insert information into a document (using document properties and variables). Part of this is also that they should be able to adjust the values they have previously entered. Changing the Name
and Value
of a document property is no problem, but apparently the variable Name
has a get property only, no set property. This is how I'm assigning a variable:
object v = _name;
Variables.Add(_sName, ref v);
This is how I'd ideally change the variable.
var.Name = newName;
But it gives an error saying:
Property or indexer 'Word.Variable.Name' cannot be assigned to -- it is read only
The only option I can think of is deleting the variable and creating a new one with the updated values. But is that really my only option?