Can I get the literal name of MergeField which define in Microsoft Word?

Can I get the literal name of MergeField which define in Microsoft Word?
I add a MergeField in doc file which look like <>, when I press alt+F9, it changes to {MERGEFIELD test \* MERGEFORMAT}.
Then I just edit this field literally like <test:ok>, and then press alt+F9, it shows {MERGEFIELD test \* MERGEFORMAT}.
The charactors are different(<> <–> <test:ok>), however, the codes are the same({MERGEFIELD test * MERGEFORMAT}).
And now, i want to get the field name, but the method MailMerge.getFieldNames() just return “test”, can I get “test:ok”?

Or can I get com.aspose.words.Field from com.aspose.words.Document before I do the method : com.aspose.words.MailMerge.executeWithRegions?

Hi

Thanks for your request. Each field in MS Word documents consists of FieldStart, FieldSeparator, FieldEnd nodes and nodes, which represents field code and field value. In general fields looks like the following:
[FieldStart]Field code[FieldSeparator]Field value[FieldValue]
What you see in the document is field value. If you press Alt+F9 you will see field code. If you need to get displayed text of a field, you should get text between FieldSeparator and FieldEnd. I think the code example provided in the following article could be useful for you:
https://docs.aspose.com/words/net/working-with-form-fields/
Hope this helps.
Best regards.

Thanks a lot, alexey.
I am trying now, and I will give a feedback to you later.

HOHO~~~~
alexey, it works, I can get the literal name of MegreField.
I even don’t know how to thank you.
I will finish all the code and tell you the detail.