DocumentBuilder InsertField MERGEFIELD Appearance

I’m writing a routine to convert in-house Word templates using proprietary tags to templates which use MergeFields in their place (using the DocumentBuilder.InsertField method). I’ve got the conversion working fine except for one niggling issue. When I open the document in Word 2007, the MergeFields are there, can be editied, etc. The issue is that they do not have the little double angle brackets which Word displays when one uses Word itself to insert a MergeField. (If one edits an Aspose-inserted MergeField and changes it in some way, the magic brackets will then appear.) I realise that I could have the business users use alt-F9 to explicitly display the MegeFields, but it would be useful if the magic brackets were there when alt-F9 is toggled “off”. Is there anyway to accomplish this?

Hi

Thanks for your request. This occurs because you did not specify field value when insert merge field. Please try using the following code:

builder.InsertField(@"MERGEFIELD myField \* MERGEFORMAT ", "½myField╗");

Hope this helps.
Best regards.