One of our users has word templates with nested field codes with have no associated code and are completely redundant, e.g. {{ INCLUDETEXT “D:\Work\TemplateMerging\TestRunner\SignatureBlock.doc” }}.
We were previously replacing field codes with values using a DocumentVisitor.
We have moved to Field.unlink instead to help us with problems with INCLUDETEXT and other types being included multiple times.
This worked a treat, thank you, apart from the {{ … }} fields that aspose doesn’t see.
doc.getFirstSection().getBody().getRange().getFields() is empty as is mailMerge.getFieldNames().
The document visitor doesn’t fire visitField methods either.
As this is entirely consist I assume its intended behavior and our users will need to review all 1800 document templates.
I have a test harness if that would help.