How to update DOC variable field using .NET

Hi Support,
I am looking to mail merge doc variable fields in the word document. Please let me know if this is possible. Also please provide a code snippet if its possible. If not possible please let me know if you have any alternative.
Thanks,
ValuePRO

Hi Piers,

Thanks for your query. Please read following documentation links for your kind reference.

https://docs.aspose.com/words/net/mail-merge-and-reporting/
https://docs.aspose.com/words/net/mail-merge-and-reporting/

Moreover, you can find complete Mail Merge documentation form following link

https://docs.aspose.com/words/java/mail-merge-and-reporting/

Please let us know if you have any more queries.

Hi Support,
Thanks for the reply. But i was trying in the same way and no success. below is the field code of the field I am using and I tried in the same way in the documentation links. but no success.
{ DocVariable mSpouse }
Please help,
Thanks,
ValuePRO

Hi
Thanks for your inquiry. Maybe in your case it would be enough to set the appropriate document variables and update fields:

Document doc = new Document(@"C:\temp\in.doc");
doc.Variables["test"] = "my value";
doc.UpdateFields();
doc.Save(@"C:\temp\out.doc");

Hope this helps.
Best regards,