We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Field names with "image:"

I am planning to get the all merge fields from word template by using below sample code.

But all image field names are comming with "image:" string, so is there any specific method to remove the "image:", "TableStart:" and "TableEnd:" from field names(Instead of general sub string).

String fieldNames[] = document.getMailMerge().getFieldNames();
for(String str : fieldNames){

Jar file verion : Aspose.Words.14.4.jdk16


Hi Prashanth,

Thanks for your inquiry. I am afraid, there is no built-in method to achieve this but you can easily remove prefix from the merge field names using standard Java code. Note that, MailMerge.GetFieldNames method returns full merge field names including optional prefix and does not eliminate duplicate field names. Please let us know if we can be of any further assistance.

Bets regards,