I have a template word document which contains some DOCVARIABLE,
I want to update those VARIABLE with new Text, like updating [Company] to ‘HP’, ‘IBM’, updating NAME to ‘Tom’, ‘Jack’, programmatically of course
Now I have successfully retrieve those DOCVARIABLE like below in c#:
Document doc = new Document("a doc");
NodeCollection fieldStarts = doc.GetChildNodes(NodeType.FieldStart, true, false);
foreach(FieldStart fieldStart in fieldStarts)
{
if (fieldStart.FieldType.Equals(FieldType.FieldDocVariable))
{
// how to upate these fields?
}
}
How do I update these fields?