I’m trying to rename 1000’s of MergeField names using a program based on the code provided by Aspose at the following link. https://docs.aspose.com/words/net/working-with-fields/
The problems is that in the MergeField object created at this line:
MergeField mergeField = new MergeField(fieldStart);
the Name is truncated to 40 characters. We have lots of fields whose names are longer than 40 characters. I noticed when I open the document in Word it is also showing the mergefield name truncated at 40 but when I edit the field the full name is there. I suspect this is what is making this code fail.
Interestingly, if I get all the field names using doc.MailMerge.GetFieldNames(); they are not truncated.
What can I do about this ? Is this a change I can make in Word ?